Some tcp-socket cleaning up

Summary: 
* Better handling of closing
* Improved names of some internal functions
* Simplified read-loop and promise usage
* Give correct errors when they happen
* Correctly stop the accept loop when closed
* Code 'NONE' used for when there is not an error (instead of always saying there is an error)
* No printing of pointless warnings for each internal socket number
* Use early return style rather than else-statements

Fixes: https://github.com/freedomjs/freedom-for-chrome/issues/12

Tested: used with socks-rtc and tested using telnet to the localhost echo-server running in the chrome app.
some of the messages are constant-style tags, e.g. 'CLOSED_BY_REMOTE', and some are actual messages, e.g. 'unexpected socket error' -- let's make them one or the other? (I vote for the latter)