fixed yieldable socket.protect in etc/dispatch.lua

Fix the yieldable `socket.protect` in `etc/dispatch.lua` and get rid of temporary tables. This `socket.protect` replacement is only meant for Lua 5.1 (and LuaJIT).