Handle code_cache dir creation in libnativebridge

Also:

- add kPreInitiliazed state to native bridge with check transition:
kOpened->kPreInitialized->kInitialized
- made sure we free the memory for the code_cache_path
- tidy up some error messages
- tidy up tests
- add a dummy native bridge to test with

Bug: 18027433
Bug: 18097480

(cherry picked from commit f9d9e2a2d96559c3165405d572b08e260156074a)

Change-Id: I9ce578949dbe522d5033465df7ca49fdd3aa3cbf
11 files changed