Correctly fail on problems checking BAM paired ends
Correctly fail on problems checking BAM paired ends

The code for checking if a BAM file had paired end reads would silently
fail if there were issues with finding sambamba or BAM file problems.
This design was due to needing to avoid pipe close errors from
sambamba/samtools since we only take the head of the file. However,
if the check failed, it would make a file look single ended leading
to loss of paired reads.

This works around this by correctly defining pipefail and resetting
the pipe signals subprocess uses to avoid erroring out. Now with
manually checking the returncode we work correctly. Fixes #1189

chapmanb/bcbio-nextgen,mjafin/bcbio-nextgen,vladsaveliev/bcbio-nextgen,gifford-lab/bcbio-nextgen,chapmanb/bcbio-nextgen,gifford-lab/bcbio-nextgen,brainstorm/bcbio-nextgen,vladsaveliev/bcbio-nextgen,mjafin/bcbio-nextgen,Cyberbio-Lab/bcbio-nextgen,lbeltrame/bcbio-nextgen,Cyberbio-Lab/bcbio-nextgen,mjafin/bcbio-nextgen,brainstorm/bcbio-nextgen,biocyberman/bcbio-nextgen,chapmanb/bcbio-nextgen,gifford-lab/bcbio-nextgen,Cyberbio-Lab/bcbio-nextgen,biocyberman/bcbio-nextgen,vladsaveliev/bcbio-nextgen,brainstorm/bcbio-nextgen,lbeltrame/bcbio-nextgen,biocyberman/bcbio-nextgen,lbeltrame/bcbio-nextgen,a113n/bcbio-nextgen,a113n/bcbio-nextgen,a113n/bcbio-nextgen