bam_merge: get rid of asprintf warnings

Get rid of the asprintf warnings by checking return value and exiting
if memory allocation fails.
bam_merge tests: fix warnings

Fix warnings caused by not checking return value of freopen and getline.
Limits -Q option (qual_scale) to sensible range 0 to 93.

Fixes wrap-around bug.
Create xfreopen() utility instead of duplicating code
Use kstring instead of asprintf()

This avoids repetitive error handling code, instead assuming kstring
will abort as appropriate.  We also avoid a C99 library function.
Merge asprintf()->kstring rewrite and warning fixes (#161)
Fix buffer overflow

Razip is on life support in this branch, but cherry-pick this from the
standalone branch anyway, in case anyone happens to use this code.