sock: fix a deadlock in blocking mode; if send and recv events are generated concurrently, we potentially ended by blocking again even if events were still pending, and therefore potentially never pushed to the application.