Atomically replace core files, recover from macOS SIGKILLs, and capture startup output for diagnostics. Fixes #224