path: fixed regex for extname() in win32

These changes mean that a string such as `//path/index.html` (with double forward slashes) is properly parsed as `'.html'` and not `''` as per issue #7386. Single or more than two slashes are parsed properly as in existing code.

_This section of code (and the bug) is only called when run in Windows, it doesn't exist in Linux._