Adjust temporary file checking to also accept py.test's tempdir

See astropy/astropy#292 for details