Fix audioflinger allocator concurrency

The allocators for the backing pools are shared between clients, so they
need to be locked.

Add a locking allocator which locks on all accesses.

Pull out some common logic into a helper in the factory.

Test: compiles
Fixes: 326429091
Bug: 326429091
Flag: EXEMPT bugfix
Change-Id: I61eb0ede32f336265f6281c865e253f181f7ad89
2 files changed