This function monitors pipe additions and removals from a socket.
monitor(sock, cv)
read_monitor(x)
For monitor
: a Monitor (object of class 'nanoMonitor').
For read_monitor
: an integer vector of pipe IDs (positive if added,
negative if removed), or else NULL if there were no changes since the
previous read.