test-bookmarks: factor hooks out to a shell script for Windows
The previous incarnation of the hooks weren't being run on Windows, which
altered the DAG and hashes[1].
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-April/096987.html