Use a fixed-size buffer for log messages

libc++'s implementation of ostrstream seems to have incorrect
range-checking and does some out-of-bounds reads and writes whenever a
resize is needed, which results in crashes on 10.7 (but not 10.9 for
unknown reasons).