Add locking within RenderEngine during rendering

Multiple threads are allowed to access RenderEngine, which poses several
issues:
1. The image cache needs to be synchronized
2. It's theoretically possible for a thread other than the SF
main-thread to call drawLayers, which can cause undesirable behavior.

Bug: 128306587
Test: manual tests
Change-Id: Ic18b71924aa3c4d72f02f95ebf928257fb9e50ed
2 files changed