Added some EOF block creation and checking.

It's not complete yet as nothing in the above directory (htslib
proper) checks this yet.
Bug fix to cram_next_slice().  The new while loop checking for
non-empty blocks caused a crash when multi-threading.
Bug fix to EOF block writing when in multi-threaded mode (not yet
supported in htslib's cram interface). It was writing the EOF block
before flushing any pending threads.
Added a check to EOF in Cram in hts_close(). Note that this isn't the
same place that BAM checks as it does it in hts_open(), however the
benefit of doing on close is that this check can work when inputting
from a pipe.
Merge branch 'develop' of https://github.com/samtools/htslib into develop
Updated the Cram EOF block detection to avoid falsely considering the
lack of an EOF block as an error when doing a sub-range query.

Also simplified the API, removing the cram_has_eof_block() function in
favour of using a tri-state cram_eof() return code.
bcf_hdr_set_samples() recognise lists vs file names
Store readrec function pointer within hts_itr_t

...instead of passing it every time hts_itr_next() is called.  This makes
it easier to have specialised readrec functions (e.g. the upcoming separate
functions for BAM and CRAM) without having to choose every time around an
iterator loop.

For SAM, also begin renaming functions to the more generic sam_itr_*()
and take advantage of moving the sam_itr_query*() functions to sam.c to
make the bam_readrec helper function static.  The other helper functions
tbx_readrec and bcf_readrec could similarly be made static if desired.
Make search key arguments *const* char pointers

(Similarly to the key argument for sam_hdr_PG_ID().  The key type
for m_s2i is in fact a const char * -- see khash.h's kh_cstr_t.)
Write strcmp() comparisons comprehensibly

(See http://c-faq.com/style/strcmp.html)
Add basic test exercising bcf_itr_queryi and bcf_itr_querys
hts_itr_querys() calls hts_itr_query() via a function parameter

...so that it can be told to use a different function if we should
need to create a different sort of iterator.
Add sam_itr_*() dealing with BAM and CRAM iterators interchangeably

For CRAM, both indexing and restriction of iteration range are done
within the cram_fd, so we create a fake hts_idx_t and a dummy hts_itr_t
that bypasses the BGZF-focussed bulk of hts_itr_t and hts_itr_next().

This is a hack.  Ideally these functions would also work with tabixed
bgzipped SAM files via a tbx_t, but it's impractical to shoehorn that
into this hack due to the various separate extra metadata items needed.

The right way to do all this would be to make hts_idx_t and hts_itr_t
both opaque types with separate bgzf, cram, and tabix concrete versions
behind them, but that would be a larger change.
synced_reader: Better handling of target alleles
Merge branch 'develop' of https://github.com/samtools/htslib into develop
Fixed initialisation of CRAM indexing when the CRAM file contains
refids that aren't sequential.
Initialise beg and end values in the hts iterator. Without these
mpileup simply bails out after fetching the first column as end is 0.
Fixed the iterator to be 1-based inclusive coordinates for CRAM.
bcf_sr_set_samples to use the new --sample convention
vcf: New bcf_get_info_flag() API