PyFITS fixes for inclusion in Astropy 0.3.1

These are all fixes that will be included in the 3.2.1 bugfix release of PyFITS.  Including these in Astropy 0.3.1 will keep Astropy in sync with PyFITS.  This includes up to changeset 5b8ee004d342a54f576fbbf67564dfb4989f8505 of PyFITS.