Fix lock mechanism in v4l2 camera HAL

Both in_flight_lock_ lock in v4l2_camera.cpp and buffer_queue_lock_ in
v4l2_wrapper.cpp have problems that guards the buffer indices and in
flight buffer vector incorrectly. Those problem leads to mismatching in
terms of buffer size between the HAL and Camera3Device and eventually
the Camera3Device will stop to wait for buffers that HAL will not post
in the future.

Bug: 69076261
Test: Camera samples app doesn't stuck with FB impl.
Exempt-From-Owner-Approval: got +2 from the HAL maintainer.
Change-Id: I3d0a4361d46571fd144a5eb8bc160296a31d6358
2 files changed