Warn if hFILE function return statuses are ignored

Ignoring the return codes from hread()/hwrite() etc leads to reliability
problems as failures in writing data will not be reported to the user.
Especially because this is internal code, use attributes to cause
compilation warnings if the error returns from these functions are
not checked.

Eventually we may have a thin hts_types.h or hts_utils.h header or
similar, to which the definition of HTS_RESULT_USED should migrate.

For now, ignoring errors from hgetc(), hputc(), and hputs() is permitted
as one may like to batch up the error checking up for these, but this
may be revisited later.
Refactoring [minor]

Move hinit_buffer() and hclose() to be alongside related buffer-using
functions, and factor out the fd_backend's fstat(2)s into a new function.
Add hseek() and htell() test cases

Test the interaction between buffering and seeking (which requires
flushing or discarding buffers), and that htell()'s reported position
is kept in sync in spite of buffering.

It remains to add tests for interleaved reading and writing on files
opened for update, but at present no htslib code uses that anyway.
Flush or discard the buffer in hseek()

The hseek() function must flush the write buffer before seeking, and
discard the previous read buffer after a successful seek.  It must then
leave an empty buffer suitable for either reading or writing (in the
case of files opened for update).

So that the same buffer value can represent both an empty read buffer
and an empty write buffer, we've replaced capacity by limit and changed
the available write space from [begin,end) to [begin,limit).

Also added hclearerr() function.  Possibly this should also clear at_eof,
although that doesn't exactly play the role of a stdio-style EOF indicator.
Maintain our own hFILE offset within the stream

Code using htell() expects to be able to call it a lot, so causing an
lseek(2) system call each time is not ideal.  Further, lseek(2) gives the
file position of the end/start of the read/write buffer (respectively),
so needs correcting to get the proper logical file position anyway.

With this change, hFILE_backend::tell() is no longer needed.
Add hdestroy_buffer() for use in hopen_*() cleaning up
BGZF worker threads do no I/O themselves

Replace worker_t::fp with just the needed item (compress_level), to
ensure that worker threads continue to not do I/O on the BGZF file
themselves.  The upcoming hFILE is (currently) not thread-safe for
multiple threads working on the same hFILE.

Also make BGZF::mt a pointer to the correct incomplete struct rather
than a void*, so casts are no longer needed with it.
Use hFILE underneath BGZF, and add bgzf_hopen()

Replace the _bgzf_open/etc macros (which may be either knet_open/etc
or fopen/etc depending on _USE_KNETFILE) for reading, and fopen/etc
for writing, with direct use of hopen/etc functions.

When reading, all opening functions bgzf_open(), bgzf_dopen(), and
bgzf_hopen() now simply peek at the first two bytes of the input file
to determine whether it is GZIP-compressed.