Clean up SpecialFilepath.

Prompted by comments on https://gerrit.wikimedia.org/r/59050
which identified problems with code lifted directly from SpecialFilepath.

Change-Id: Iab8a5d3d007b3aca72b7c6c1145d830a74b4399e
Merge "Clean up SpecialFilepath."