fix($location): don't rewrite when link is shift-clicked

Closes #9904