As message_hook/3,
but this predicate is local to the calling thread (see thread_local/1).
This hook is called beforemessage_hook/3.
Theāpre-hook' is indented to catch messages they may be produced
by calling some goal without affecting other threads.