AliasRegistry and RemoteRegistry duplicated the lock-file, read-modify-
write and atomic-replace logic almost line for line. Move it into a
generic JsonRegistry base; each registry now only declares its error
type, empty value, parser and serializer. Behaviour, file format,
permissions and the corrupt-file guarantee are unchanged.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>