avoid race condition in updating system_status_duration table

Bug: 903902
Change-Id: If153a72f424a710447f4e730fa77d5afc4f88a99
Merge "avoid race condition in updating system_status_duration table" into develop