Add memory management to util::Task.
Fix a race condition in the master election.

It was only when stopping the election, so not too major, but still, let's
fix it!
Add some sanity methods to allow blocking methods to check that they're not being called on the libevent thread.
.
Support turtles all the way down (because libevent does