(1)-(3) Nice. All fixed, I think. As possibly more (linked 4 bugs now).
(4) surface_map is no longer protected by a mutex in MirConnection. But now I see it has its own built-in. That might be worth a comment where it's called by MirConnection.
(5) This is getting very complex and hard to review now. Not least because the diff doesn't show what's protected by each lock_guard. I suggest aiming to only fix one bug at a time in future :)
(1)-(3) Nice. All fixed, I think. As possibly more (linked 4 bugs now).
(4) surface_map is no longer protected by a mutex in MirConnection. But now I see it has its own built-in. That might be worth a comment where it's called by MirConnection.
(5) This is getting very complex and hard to review now. Not least because the diff doesn't show what's protected by each lock_guard. I suggest aiming to only fix one bug at a time in future :)