replace_ext: fix matching of "any" old ext

If you pass undef as the "old" extension parameter, we will
match any extension that does not contain a dot. We use a
regex to do so, but it does not work; we quote the user's
input via \Q, and therefore accidentally quote our regex.