fix deadlock in before-gc-hook on certain 7.2alpha gc versions