Avoid unlocking a mutex in a thread that does not own it (LP: #1427976).
SessionMediator unlocks its session_mutex before invoking rpc callbacks. This becomes cumbersome when SessionMediator needs to call Surface::swap_buffers, as the completion function may be executed in an entirely different thread.
The session_mutex should only be unlocked if the completion function is invoked during Surface::swap_buffers.