Fix GZIP block bugs in BAM file input
Exit on file write failure