On UNIX systems try to store kernels in tmp dir

This change adds a new compiler definition HAVE_UNIX and uses P_tmpdir to store
the kernel files in a temporary location rather than the current working
directory.

There are two reasons why I think this would be a good addition: 1) it doesn't clutter my current working directory and 2) I cannot always write in my current working directory.