tor_api: Some way to capture stdout/stderr

In legacy/trac#25510 (moved), hellais says:

  •  Ability to get the output of tor_run_main() without having to mock standard out

There is a wealth of information inside of the log output of tor, which would be nice if it were exposed in a more API friendly way (maybe some sort of callback function?) so that a user of the library doesn't have to mock stdout/stderr.