Fix potential deadlock in shutdown in HistoricalRegistry

Ensure that the memory lock is released before calling
persistPendingHistory in HistoricalRegistry.

Bug: 172776374
Test: none
Change-Id: I909de9f83cd43c695d0db99f82252ce36a0b972b
1 file changed