Pyfits merge--fixes for 0.2.5

I have a few new features that need to be merged into Astropy as well, but for now I've separated out any recent PyFITS changes that constitute "bug fixes" into a single PR so that they can be easily backported to 0.2.x.