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
Fix compilation with the Clang compiler.
Fix type mismatches between types in sizeof() in malloc/calloc/realloc calls. This generates a warning in the clang analyzer, designed to catch incorrectly sized memory allocations.

The allocation at bam_plcmd.c:208 is twice as big as it needs to be, and has been fixed.
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.
bcftools: more informative error message, print position of the bad site
Added a few comments.
mpileup now handles overlapping reads, not counting the overlaps twice. This is a largely untested, backup commit.
mpileup: overlap soft-clipping moved out of user space (mplp_init) into plp core library, otherwise first pair is not accesible for clipping
plot-bamcheck: New -m option for merging multiple bamcheck files. All sections except GC-by-depth.
mpileup (overlapping reads, continued): Instead of soft-clipping the first read, set quality of conflicting bases to 0. Include command line in VCF header.
mpileup (overlapping reads, continued): fixed a bug, check a single base, not multiple
This is a broken version: backup commit
Fix in kt_fisher_exact: prevent infinite loops. Speed up call_multiallelic_gt for ref-only sites. Cleaned overlap code in bam_pileup.c
Merge remote branch 'origin/master' into develop
bam_pileup.c: Skip unpaired reads or reads with unmapped mates.
Changed code where variable used for getopt is then reused by later code for completely different purpose.
razf_read and razf_write are intended to replace system calls of read and write respectively and thus their method signature should match.
Tweak method definitions of knet_read and knet_write to better match system read and write.
Add const modifier to certain global constants.
Add static modifier to global constants where possible.
Delete unused constants
Be consistent about using float or double in errmod depcorr
Adjust position of fileret in _razf_read and ensure correct variable is returned.