Use a temporary file instead of $^X when testing stat.

Otherwise there's a subtle race condition on the last access time, which can
cause the test to spuriously fail. I'm surprised that we've not seen this
failure until today.