BITMAG-738 Improve multi-threading for the handling of the messages: Improving shutdown functionality.