htslib/caveman1.5.1

@drjsanger, can you review the changes please, mostly minor.