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.
Thanks, name changed and typo fixed. 

I agree, it's not good, but it's currently the way freedom modules are defined: error constants are strings :/ 

These strings come from Chrome, but that's a first approximation for a generic set of error messages. FF may map numbers differently, but should have the same kind of error numbers. 

I've filed an issue for freedom to have error codes for tcp and udp-sockets (https://github.com/freedomjs/freedom/issues/69)

I've files an issue in freedom-for-firefox to check that error numbers are correctly matching to strings, and to add any missing strings. https://github.com/freedomjs/freedom-for-firefox/issues/8

Longer term, would be nice to be using typescript-style enums.