ast: Ensure trailing newlines are ignored when storing FITS cards