FilesystemCache sanitizes filenames before writing

Using the provided filename as the prefix for tempnam() lead to not being able to write the cache file if the filename had illegal characters. Characters other than letters, numbers, dashes, underscores, and full stops are now replaced with a dash.
This can cause collisions when `-` is used in file names: can you come up with a test case where such collision is happening?