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.