Improved locking for periodic registry refreshes

In the very unlikely case where applying registry updates take > than the update periodicity, a subsequent update thread can trample the previous (still updating) thread.