#39 - race on function static causes AV

This moves function statics to class statics. Side effect is that the
event_loop threads are started even if they are not used. A future
change might make event_loop thread creation lazy.