Handle erroneous modes with neither 'r' nor 'w'
Merge branch 'develop' of https://github.com/samtools/htslib into develop
Robustness improvements following fuzz testing. (See io_lib r3500).

While not rigorous, this is the result of 3000 trials of making 100
random edits to an uncompressed CRAM file and decoding it as SAM.