Optimize communication with file io server

The monitor ref is used in the protocol messages to optimize the
selective receive expressions. Th old protocol without references
is still supported for backwards compatibility.