OF-771: Ensure proper shutdown for MUC module

When the server is shutting down, messages to persistent MUC rooms
should be written to the DB.