libgui: fix a race in CpuConsumer::lockNextBuffer

mCurrentLockedBuffers must be accessed with the mutex.  Constify
mMaxLockedBuffers as well for clarity.

Test: libgui_test
Change-Id: I7c40d135bcf2aa6a90ecff74d6d8107fc530e815
3 files changed