Simplify implementation of the C version of createTemporaryFile