pstore: Avoid deadlock in panic and emergency-restart path