Fix concurrency bugs in BCC JIT cache.

ContextManager could potentially be accessed by multiple threads
so we now use a Mutex.

Fixed a bug in ContextManager where it could mark a slot as having
been assigned even though the subsequent call to mmap failed.

Added code to delete the cache file before recreating it.  The existing
file may still be mmapped and executing somewhere else so we don't want
to modify its contents.

Bug: 3345334
Change-Id: I9c8382d9695741b92a4f66c4529ebb5d9a95f1d9
3 files changed