sim: Add the ability to lock an event queue

We need the ability to lock event queues to enable device accesses
across threads. The EventQueue now implements the BasicLockable C++
concept to facilitate such locking. This lock is taken by
EventQueue::serviceOne when serving events and it should be taken
whenever the event queue is going to be manipulated. In practice,
events can be scheduled from event handlers so existing code still
works as expected.

The intended use for this functionality is when devices need to be
called across thread boundaries. For example, when fast-forwarding, it
might be useful to run devices and CPUs in separate threads. In such a
case, the CPU locks the device queue whenever it needs to perform IO.
This functionality is primarily intended for KVM.