Fix tests on 24.3

For some reason, 24.3 doesn't like let-binding of hook variables, so we
now use our own hook function which enables Merlin Mode locally.