Visit stack trace roots

We need to visit the declaring classes of all the methods in the
allocation stack traces to prevent class unloading for these
methods. If the class gets unloaded, it will free the linear alloc
resulting in hprof crashing during dumping.

Also a bit of clean up.

Bug: 26849503

(cherry picked from commit a7deef9260bd53dfd6b51ace02b4e6200078d5ea)

Change-Id: If7df7259d0e5044dbcf35f5b4e86f6cf2e583adb
1 file changed