Raise error if give @HD SO:coordinate to 'samtools fixmate'

The (minimal) documentation does tell you 'samtools fixmate' requires query name
sorted reads (in fact grouped by query name is enough), but doesn't actually raise
an error if given coordinate sorted reads (it just silently fails to fix them).

This change raises an explicit error is the @HD line contains SO:coordinate
Catch overflow in n_cigar and give an explicit error.

Due to the use of an unsigned 16bit integer, BAM
files can only hold reads with up to 65535 CIGAR
operators. SAM does not have this limit, but the
samtools implementation (reasonably) also has the
same 16bit limit.

Prior to this fix a very long CIGAR read would
give a confusing 'unmatched CIGAR operation'
warning and then abort with a core dump.
Don't set text-is-cached flag if reading headers encountered EOF

Only set is_first (i.e., some SAM record text has already been read
in) if a column of the following SAM record has actually been pre-read.
This will not be the case if there are no records at all, only headers.

Fixes #113 (hattip @kmsquire).
Merge pull request #20, fixmate aborts on SO:coordinate
Fix buffer overflow
Remove double fclose()

This fixes issue #47 for the legacy non-HTSlib code branch.
Silence -Wstrict-prototypes warnings in main header files

Fixes issue #45 for the legacy non-HTSlib code branch.
Merge cigar length check (PR #39)

Revise Peter's patch to use parse_error(), as per other CIGAR-related
errors and so that samtools view has a non-zero exit status.
Fix control of compression level in bam_merge_core2

(Fixed on develop by 3ef90e939e170880431b880641034c8d78f885b2.)
mpileup: New optional FORMAT/DPR and INFO/DPR annotations
mpileup: Output symbolic <X> allele instead of VCF-incompatible X
Save the right error text (fixes cut-and-pasto)
Added CRAM reference information and an example.
Update license file

Rename to LICENSE, as the filename COPYING usually suggests GPL.
(Use git diff -M40% to see this commit as a rename.)

Use the less ambiguous term "MIT/Expat" license, as there are several
different licenses sometimes called the "MIT license".

Update years in the copyright notice, and add note about year ranges.

Reformat the last paragraph -- there are no text changes.
Report file opening failures rather than crashing

Fixes #238.  Hat tip @kern3020.
Note explicitly that merge output remains sorted
Report errno for file opening failures

Use print_error_errno to report these and also in other places where
errno is being reported.  Don't report errno in add_read_group_single();
currently usually kh_ hash functions fail due to conditions that set
errno, but this is not guaranteed.
Implement bam2depth directly against the htslib API
Report index and region failures rather than crashing
mpileup: Support for cigar operator "P", resolves #243