Fix side effects of trace-ipc and dumpheap commands am: 4c0b9a5fbd am: 5518a714f3 am: cb8e4e8db6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14982641

Change-Id: I65246cca8e1b07d7005ef298505e2dd688d22ced