Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memory