Use atexit function to prevent hangs on exit

If network.close() wasn't called, it could result in a ZMQ crash,
causing the process to hang. Typically, blueox.shutdown() prevented
this, but in cases where shutdown() isn't called, it can be bad news.