cache formatted log lines

cache pre-formatted log lines to save a significant amount of CPU time
in the backtrace code. Measured hit ratios using this super-simple
2-level cache average ~96%.

The second step in backtrace optimization will be to minimize the calls
to fprintf.

Signed-off-by: Jeremy C. Andrus <jeremya@cs.columbia.edu>