st-hal: Add buffering thread independent of callback thread

Currently, the callback thread handles detections and buffering
which causes complicated synchronization support. This change
simplifies buffering by adding a dedicated thread so that the
callback thread can return to waiting for detection events.

Change-Id: I994e1524207e967d67f7a262934b476d58778358
4 files changed