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.