Add support for paths without trailing separator in TemporaryFile