Alter encoder / decoder to handle errors

Changed the WriteResponse function to always write the header, and
conditionally write a body if there is no error in the rpc.Response.

Changed the ReadResponseBody to not attempt to read the object if it is
nil, as the net/rpc Client passes a nil object on error and when there
is no pending call (http://golang.org/src/pkg/net/rpc/client.go line
118)