Python C-Extension using pthread to reimplement threading.Event