MDL-54687 core_message: remove contact from DOM if no messages remain