Escape special regex characters from filenames.

This is especially important on Windows, where \ and () are
prevalent in filenames.