Revert to kstring.h with a separate kstring.c

Revert to our kstring.c/.h prior to 18ac8061fbf174784b8f169523adab2cd5226b17
which, having a separate C file, is more similar to the kstring in samtools
and klib.
Fix <stdarg.h> include

As we no longer get this by accident from kstring.h, include it ourselves.
Merge changes from samtools's kstring

Adds kputl() and a bug fix for kputw(INT_MIN).  This kstring.h is now the
same as the current samtools one, but with kputc_() and kputsn_() added.

(The same bug exists in this kputl(LONG_MIN), so that function will need
fixing or reimplementing in due course.)
Replace with samtools's ksort

We previously had a stripped-down ksort.h; this re-adds the other
sorts alongside introsort and fixes a non-static inline.

This ksort.h is now identical to the current samtools one.
Add klist.h, as used by samtools

This is upstream klib's klist.h, which differs from samtools's
previous version only in copyright boilerplate and include guard.
Maintain the same API regardless of -D BGZF_MT

As is done for BGZF_CACHE, bgzf.h should expose the same ABI (both
API function and structure layout) regardless of whether BGZF_MT
is defined.
Expose bam_hdr_init() in the public API header
Avoid conflicting with samtools's bam_index()

There will likely eventually be a public API function similar to
this bam_index() (which is unrelated to samtools's), but it will
have different parameter types and perhaps a different name.
Merge branch 'for-samtools' into develop