better tmp directory handling for linux