MDL-64632 core_message: fixed PHP error when users are deleted from DB