added creation of a tmp directory if it doesn't exist

The application creates some temporary files, storing them in a
directory called tmp. Added code to make sure that the tmp directory
exists when the program is starting.