Updates to master to add IO error checking

Recently at the Sanger, we have noticed some cases where bwa has missed I/O errors from Lustre file systems, causing it to output incorrect alignments while apparently completing successfully.  To prevent this, I have made a version with extra wrappers around all of the I/O and memory allocation functions so that any problems are caught promptly and cause the program to exit with a failure code.

The main changes are:

* Extra wrappers around I/O functions to catch errors and other issues like short reads.
* Wrappers around malloc etc. so that users who run out of memory get a polite message instead of a random core dump.
* Changed error handling so that trivial problems like passing in the wrong file name don't result in a core dump.
* Call fsync as well as fflush when flushing files.  fflush on its own is not enough for networked file systems as the operating system may not notice that the partition was full until after the program finished.

Could you pull these into your copy, please?  We plan to use these changes in our production pipeline, and I would rather that they were in the official version instead of my fork.

Thanks,

Rob.