Write BAM index file
Handle headerless SAM files