Fix how bamtobed -bedpe handle the last read

GetNextAlignment's return value is not checked for bam2 so if the last read has no mate then the algo will print a paired-end read based on the latest value of the bam2 variable.

Here is an example:

myreads.sam:
//header
nameA	\d	chr1
nameA	\d	chr1	
nameB	\d	chr2	
//eof

Command:
bedtools bamtobed -bedpe -i myreads.bam

Output:
chr1 ... nameA
chr1 ... nameA


Problem solved by checking the return value of GetNextAlignment for the variable bam2 and output an error message on stderr.