Allow sam files with no reads to be converted to bam files

* Without this patch, the last header line is treated as a read.
* Useful in pipelines which split up inputs into small pieces
  and filters them.