Rework mailbox change check fix for better thread safety
Avoid holding editing lock more than necessary, fixes #1047