Use a mutex to synchronize the guest access (deadlocks seem to happen otherwise). Fixes #8.