Get multi-platform tmp dir

When using platforms where "/tmp" wasn't the default temp directory AND
you wouldn't define a specific `tmp` directory the middleware would
throw an error.