Return more data from JSON-RPC errors.

Make the error code and data payload available when JSON RPC
errors occur.

Change-Id: I615362d397ba442995f2ea9cdae0badb743dc72a
Improve robustness of local socket implementation.

Before these changes, the connection would fail under heavy
use. By moving to more asynchronous read mechanisms in both
the client and server and offloading more of the processing
into the event loop, packets are no longer missed and the
connection continues to work after bursts.

Change-Id: I875049240600414eaab43313416c713735947eab
Merge topic 'client-error-api' into master

f57d1258 Improve robustness of local socket implementation.
a3fef261 Return more data from JSON-RPC errors.