Fix File-related tests

The tests were working on Linux but suddenly fail on Mac OS X in which the
canonical path of a (temporary) file might be different from its absolute path.