Escape non-ascii bytes in tracebacks line-by-line instead of all at once.

Previously if there were any bytes that needed escaping, the newlines
would get escaped as well, ruining the message formatting.

Closes #675 (again)
Add a workaround for a bug in the latest version of libcurl
Make LogTrapTestCase fail more gracefully in unknown logging configurations.

This allows LogTrapTestCases to be run under nose, which does its own
log buffering.

Closes #674