Workaround for older pyfits versions.
Older pyfits seem to have the bug that hdulist.close() raises an exception
on memory mapped files. This is the case for Ubuntu 12.04. So, for the
test cases, we catch all exceptions on close().