Continue r21733

[reviewed by Brad]

In r21733, I changed all of the IO routines to use ref or const ref
instead of inout. But, there were bugs!

1) The fielderator (get field name/value by index), which is
   used in the default implementation of read/writeThis routines
   for user types, was not correctly handling the case in which
   its argument was of a reference type (it tried to return
   _val). The fix is just to educate it about reference types...
2) I had not moved all of the functions in ChapelIO.chpl to use
   the ref intent. Fix that for consistency and so we have fewer
   cases to deal with.
3) (possibly temporarily) reads on a remote locale that call
   into a C function to do the reading were passing in a wide
   reference to the C. That's bad, so for now just make
   read functions use the inout intent instead of the ref
   intent. I'd like to put it back but I'm trying to isolate
   a compiler bug that comes up.



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@21753 3a8e244f-b0f2-452b-bcba-4c88e055c3ca