Fixes crash while processing offline changes

processPendingChanges copies the pending keys into a new set to prevent a 'mutated while being enumerated' exception from being thrown.