Fixed resource leak and improved BAM parsing

There was a subtle resource leak where the pool of fragment structures
would become exhausted if the number of alignments wasn't a factor of
the mini-batch size.  This only occured in *very* rare cases (where
we pass over the alignment file hundreds of times), but it was,
nonetheless a bug.

There are also significant improvemnts to the way that the parsing of
alignments are handled.  There's extra error checking, and we now
properly deal with unpaired alignments in a paired-end BAM file.
Because they present a significant parsing challenge, discordant
alignments are not currently suppored (they are simply discarded)
if they appear in the input file.