Avoid using the Str module. If a user has only Pervasives installed, LWT's
configuration utility shouldn't fail. This version of replace_last only uses
functions from the Filename module. (This recommendation came from @diml
on GitHub.)