Fixed broken behavior in the makeflow wrapper support:
Substitution of the nodeid into a wrapper command or file
is now done on the symbol %% instead of $RULE.

The dollar-syntax doesn't work, because dollar either indicates
macro-substitution that happens during parsing, or environment
variable substitution at runtime.  The substitution for the wrapper
happens in a third place (at command generation) and must simply
be represented by a different symbol.

This fixes the failing makeflow export tests.
Updated docs to describe the %% substitution
%% can now be escaped by %%%% if needed.
Note that a backslash escape won't work here
b/c that will conflict with shell backslashes.
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 pull request #601 from dthain/master

Makeflow Wrapper: $RULE -> %%
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.
Use cheaper static array.
Use simpler stack buffer.
Remove redundant free.
Use exit/fatal.
Handle /proc/self/fd and /dev/fd.

Parrot was trying to open these file descriptors as normal files. However,
these descriptors might actually refer to a native file, like a socket, so
Parrot should pass the open on to the kernel unmodified. In the case of a
Parrot file descriptor, we want to create a new file description (pfs_pointer).

readdir on /proc/self/fd also now omits special file descriptors (like the
channel). This might not be the best solution. In an ideal scenario, the tracee
can't see the channel at all. However, the channel does use up one of its file
descriptors and that has side-effects (e.g. dup2 to the channel file descriptor
will inexplicably fail, from the application's perspective). Any fix for this
is probably involved and I'm not aware of any application negatively affected
by this.  The best solution for now seem to be to hide the channel in
/proc/self/fd results. [I *have* seen applications try to close the channel fd
before, because they found it via readdir on /prof/self/fd.]

Fixes #598.