Fix /tmp directory by secure location

Note that this haven't been tested thoroughly...