Fix breaking if os.tmpDir() is not ended with a slash.

Also changed web handler to use our createTmpDir() function instead.