fix deque pop bug in gunicorn gthread worker