make socket.protect yieldable on Lua 5.2/5.3

Second part of yieldable `socket.protect`.