Throw errors if runs exec() on a closed socket

- Follow advices from here
https://github.com/mscdex/ssh2/issues/72#issuecomment-39975258