check return value of zmq_socket

I reverted the commit where I played around with passing an optional context to zmq.socket().
Also, throwing an uncaught C++ exception never printed the error message to my terminal so I just use fprint(stderr, ...) and exit.