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
(cherry picked from commit 42387ceaedd6d6d53706e799486161db7fffcce5)
1 file changed