Made compact() thread safe

:Release Notes:
Ignore calls to compaction if it's active already.

:Detailed Notes:

:Testing Performed:
tested on local build

:QA Notes:
use purge() and compact() calls to db8.

:Issues Addressed:
[BHV-3160]  Eliminate possible crash via compact() call

Open-webOS-DCO-1.0-Signed-off-by: Igor Kuksyuk <igor.kuksiuk@lge.com>

Change-Id: I94021abfb59de3a5c44266a57c27185dd424c60f
Reviewed-on: https://g2g.palm.com/5086
Reviewed-by: DCO Verification
Reviewed-by: Igor Kuksyuk <igor.kuksiuk@lge.com>
Tested-by: Igor Kuksyuk <igor.kuksiuk@lge.com>
Reviewed-by: Maksym Sditanov <maxim.sditanov@lge.com>