improvements to zero-copy cuda arrays.

specifically, you now mark the host/device as dirty instead
of refreshing.  this eliminates unnecessary copies.
i also fixed a bug in getting the length of the array
when provided by the client as a device array.