Fixes #9221 ("message_queue deadlock on linux")