Add `.terminating` hook to worker wrapper.