hwc2: Add missing locks, relax some locks

Currently calls forwarded to CallDisplayFunction and CallLayerFunction
are not protected via a lock, causing races. Add scope lock.

Relax sequence locks in SetPowerMode, Dumpsys and Create/Destroy layer
to scope locks to avoid locks ups in cases where these get called from
the same binder thread that called Validate.

Change-Id: I22bfc13b61dc308208cb20e8b2f3c2f76dbcafd4
CRs-fixed: 2156131
3 files changed