Preserve pathname when adding query argument

This should address https://github.com/zotero/styles-repo/commit/c171cefdd393160612cb42bcd1cadfa3c43b80c4#commitcomment-3887922