Correctly handle instrumenting threads multiple times.

We had a problem where if threads were instrumented multiple times we
would have CHECK failures as the final non-upcall frame would have an
unexpected return-pc. This changes the check logic to ensure that we
are robust with respect to that. This could happen when a thread was
instrumented while tracing was enabled.

Test: ./test.py --host --trace --ntrace --stream -j50
Bug: 67384421
Change-Id: Ic5aadf9e7db964aea653ac57a4d36eccbeac699d
2 files changed