Success for ticket_get is >= 0.
Use common I/O and output buffers for all RPCs.

The common I/O buffer:

+       void *buffer = xxmalloc(MAX_BUFFER_SIZE); /* general purpose temporary buffer */

is allocated once and used for all I/O RPC. We no longer repeatedly reallocate
a buffer for pwrite/pread/etc.

The output buffer for RPCs is now in a buffer_t. Most RPC now use this for
"extra" output (e.g. pread) instead of allocating memory on the heap each time.

There is also other smaller cleanup such as using fewer variables on the stack,
better variable scoping, and consistent error handling. Also a few minor bugs
have been fixed, like the stat update for unlink.
Merge remote-tracking branch 'ccl/pull/609/head'

* ccl/pull/609/head:
  Use common I/O and output buffers for all RPCs.
  Success for ticket_get is >= 0.