Cherrypicked changes to testzmq for running on Linux with no random command