hook: narrow the 'priority' prefix check to align with the documentation
A prefix like 'priorityfoo' is meaningless, but `hg help config.hooks` calls out
the dot.
windows: don't consider '$$' to be an escaped '$' when translating to cmd.exe
This functionality was inherited from `os.path.expandvars()`. But the point of
adding this translating code is to be able to write a portable hook, and bash
wouldn't replace '$$' with '$'. Escaping with '\' works, and is portable.