Backup maindb if database corrupted

:Release Notes:
Backup corrupted database before factory reset

:Detailed Notes:
If maindb corrupted, backup it and after backup store it
for future analisys.

:Testing Performed:
Compiled and tested localy.

:QA Notes:

:Issues Addressed:
[BHV-1557] We need to remain logs why factory reset happens

Open-webOS-DCO-1.0-Signed-off-by: Maksym Sditanov <maxim.sditanov@lge.com>

Change-Id: I55b76a8ab60b62e951ffc678b3a4318e90f5db6e
Reviewed-on: https://g2g.palm.com/4900
Reviewed-by: DCO Verification
Tested-by: Maksym Sditanov <maxim.sditanov@lge.com>
Reviewed-by: Oleg Yablokov <oleg.yablokov@lge.com>
Reviewed-by: Olexandr Solomakha <oleksander.solomakha@lge.com>
Reviewed-by: Maksym Sditanov <maxim.sditanov@lge.com>