simpleperf: fix ReadAuxDataFromKernelBuffer.

Record buffer is a circular buffer. AllocWriteSpace() allocates
a continuous space from it.
If alloc_size > record_buffer_critical_level,
AllocWriteSpace(alloc_size) may fail even when free_size >= alloc_size +
critical_level. So we need to handle that situation.

Bug: none
Test: run simpleperf_unit_test
Change-Id: I3fc82162fb00bde644086b4e277e631434fad304
2 files changed