fix freezing by adding timeout for recv messages via zmq.