On open failure, set errno instead of printing message

Having this low-level routine printing diagnostics itself causes
problems now that hopen() is used to resolve files via paths such
as $REF_PATH.  If the file is fulfilled by the second path entry,
a not-found error may already have been printed from the first entry.

Instead set errno so that higher-level callers have a chance to emit
a useful error message themselves where appropriate.
Expose bcf_hdr_parse
vcf: Expose bcf_hdr_sync() and hrec_add_idx()
vcf: bcf_hdr_get_hrec() interface made more general

Changed behavior of bcf_hdr_combine() to be more terse, don't
add generic header lines with the same key. This may be not
desired in some situations, in that case a new parameter 'flags'
can be added to control the behavior.
mpileup: Support for cigar operator "P"
faidx: new faidx_has_seq() call
faidx: Fixed copy-and-paste documentation error
hts_file_type: correct return of FT_VCF_GZ
Merge pull request #113 from mcshane/feature/hts_file_type_fix

hts_file_type: correct return of FT_VCF_GZ
Don't call freeaddrinfo() when getaddrinfo() fails

POSIX is somewhat unclear here, but doing so segfaults on some
platforms.  Hat tip Kamil Slowikowski @slowkow.

Instead print a more detailed error message using gai_strerror().

[Cherry-picked from patch submitted to upstream klib.]
Bug fix in bcf_trim_alleles()
Added comments
Fixed bug : decrement n_info when removing INFO tag in bcf_update_info
Fixed bug : decrement n_fmt when removing FORMAT tag in bcf_update_format
Fixed bug : bcf_hdr_id2hrec_fixed added

Added debug flags in Makefile for use with gdb
1. Move elements of d.fmt array left when deleted in update_format()
2. -O3 in Makefile
1. Modified synced_bcf_reader to work with merges for gVCF files. Main
change - add a field in reader called last_valid_record_idx. This allows
vcfmerge to split intervals and add it to reader->buffer by manipulating
reader->nbuffer and reader->last_valid_record_idx
2. DEBUG flag in Makefile

TODO: FIXME
1. Terrible hack: Added boolean flag called is_split_record in bcf1_t
structure to determine whether a BCF record was created because of a
split in a gVCF interval. Used in a terribly hacky manner in vcfmerge.
Should be removed, once I have figured out how to obtain REF from
location.
2. When INFO and FORMAT fields are erased using update_info with NULL
arguments, I shift the elements of the info and fmt arrays and decrement
the values of n_info and n_fmt. Likely, we should set NULL pointers in
the deleted indices and not change n_info/fmt. This will be
faster;however, any applications using this must check for NULL
pointers as a proxy for deletion. Right now, vcfmerge does not work with
NULL pointers method, but works with the shifting method.
a. Fixed indentation
b. Incorporated Petr's changes for bcf1_sync
bcf_hdr_id2hrec  has been fixed in develop branch, so no need for
bcf_hdr_id2hrec_fixed.
1. Extracted the INFO field corresponding to END tag to bcf1_t
(m_end_point). This saves a significant amount of time while doing
merge operations.
2. Likely a bug fix - when update_info is called with NULL for values
and 0 for nvalue, the entry is marked as deleted (vptr = 0). However,
subsequent calls to get_info or get_info_values do not seem to check if
vptr is NULL.
3. Reverted update_info back to not editing n_info, but simply setting
vptr = 0.
4. FIXME: There is some kind of nasty memory bug when update_info is
called with NULL for values (i.e. INFO field is removed from bcf1_t). I
have not been able to find the bug as of now.
a. Added support for NON_REF variant used in gVCFs
b. Reverted to not changing number of fields in update_info and
update_format when a field is deleted
c. Fixed bugs in bcf_hdr_remove (nullify info, key, val fields)
d. Added a function to search for a key using simple linear search for
hdr->id[BCF_DT_ID][]. This is useful when there are 2 fields, one in
INFO and one in FORMAT with the same name (example, DP in the gVCFs).
See function bcf_hdr_field_name2id
e. Separated functions to directly update bcf_info_t and bcf_fmt_t. This
is useful when iterating over format and info fields for a line. No
string search needs to be performed (see functions
bcf_update_info_struct, bcf_update_format_struct and
bcf_unpack_info_values)
f. Added a function to set length descriptor (BCF_VL_*).