[debugger] Add a flag to dump build ID mapping.

When debugging missing symbol problems it can be helpful to see zxdb's
index of build ID to file mappings.

The new flag added to the sym-stat command dumps this.

Improves zxdb output. The large dump exposed a problem where fwrite
would do a partial write because the output is in nonblocking mode. This
forces stdout into blocking mode.

Related to this, I noticed that the line input uses write() to avoid
buffering but the output uses fwrite() because we want buffering. But
switching tbetween the two requires a sync.

Does some cleanup in OutputBuffer of string handling since we now have
string_view.

TEST=manual
DX-902

Change-Id: Ib8e8c2455a1d3f4bd1ce9a332e2134206fdaa940
5 files changed