Emit or throw error on exec() and connect()

--Overview
* Implementation for issue #161
* Treat twice connect() as a programmer error, throw error immediately....
* Treat exec() on a closed socket as operational error, emit error instead of throwing error
* Provide 2 test cases for testing above implementation. However, you need to modify a bit on connect() calls.