Fixes spacetelescope/PyFITS#28 by backporting the fix from Astropy. As far as I can tell I don't have a ticket for this issue open in Trac--I thought I had fixed it a long time ago before it came up in Astropy.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@2244 ed100bfc-0583-0410-97f2-c26b58777a21
This fix should be included in 3.0.12 too.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@2245 ed100bfc-0583-0410-97f2-c26b58777a21