Some fixes to improve compliance.

Fixed the TCP test to make it work on Windows and please use lua_rawlen instead of lua_objlen because it has been renamed in Lua 5.2.