ensure_bam_sorted: compare read contig ID as well as position

If a BAM has insanely shallow coverage, the first 50 reads might go past the
first chromosome, in which case the next read has a lower position than the
previous, but on the next chromosome.