Invoke event handlers concurrently.

`InstanceConfig` has been put behind a TVar, allowing safe concurrent
access. Furthermore, a global lock has been added (currently only
used when sending messages) to ensure the concurrency doesn't mess
things up.

`instanceConfig` and `putInstanceConfig` behave in exactly the same
way, however there is also an `instanceConfigTVar` accessor so people
can make use of the concurrency for communication purposes / resolving
conflicting state updates if they wish.