Port fixes from samtools razf.c/h to htslib.

This ports the size_t and ssize_t signedness fixes from samtools to htslib so they don't get lost in a merge