ART: Make graph visualizer thread-safe

Store visualizer to a temporary string stream during compilation.
Print to the final output on destruction, and do so under a lock.

Note: the order of methods in the output is only guaranteed to be
      deterministic with single-threaded compilation (-j1).

Test: m
Test: Compile multithread
Test: Check output file that begin_compilation and end_compilation
      are interleaved
Test: Check that names of compiled methods match

Change-Id: I7eb3be2f88333cf1f116fe71b77cffa1ac702208
1 file changed