liblogcat: add simple stdout redirection

Provide minimal redirection functionality, adding stdout redirection
to the existing stderr redirection parsing.

- stderr and stdout redirection do _not_ support append, will treat
  like write only.
- stderr redirection does _not_ support filename. Only 2>&1 to
  join stderr and stdout and 2>/dev/null to drop content on floor.
- stdout redirection supports filename only.
- stderr 2>&1 redirection must be last for shell compatibility.
- preserve 2>&1 through file rotation (bugfix)

Test: logcat-benchmarks --benchmark_filter='BM_logcat_popen*|BM_logcat_system*'
Bug: 35326290
Change-Id: Id36b59358167f21381bd1dbf0bd7a7e10e2a2ed9
1 file changed
tree: 6d1a48e89c2a9c23f64015304c11c21b73bcd9e7
  1. liblog/
  2. logcat/
  3. logd/
  4. logwrapper/