Fix OS X issue in tests

@rjackson says that Dir.mktmpdir might not return the true path, so we
have to expand it.