Added Synchronization block to avoid Race condition

While removing the top activities of crashed process from the
history stack sometimes it was leading to race condition and
decrementing history stack index twice. because of this index
out of bound issue was coming

Change-Id: I9493ddf13c47c0929a4e291dc5592df6314d067b
CRs-fixed: 483717
Remove opaque check in GLRenderer when preparing dirty region.

Since preserved swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage to be present from the previous process in the color buffer.

CRs-Fixed: 391492, 403067, 405916

Change-Id: I1f72a3dee2f5d58a984f4cd367c9f7bf08ab9d6a

Conflicts:

	libs/hwui/OpenGLRenderer.cpp
framework: [webkit] calling perfLock interface when chrome browser
runs heavy workloads like JavaScripts and canvas contents.

Change-Id: I61e117fd9e6f88ee3f88e2587e70d7552ab563a6