Fix traces generated from an async invocation of atrace

Cherry-pick of 977b6ae5eacf2bef7d54b0291728959a6e581dd6 from AOSP

Such traces can become inconsistent because the trace buffers
are kept per CPU. To work around this the prefix of the trace
where not all CPUs have data yet are discarded.

Bug: 21037114
Bug: 19437218
Change-Id: I8e0c5d5eab89a81691a3dfe485b62f76c7c1535c
1 file changed