lock in pythonqueue and better deferredcoroutine