Added backup copy creation during keys.dat write to prevent an accidental file loss due to the disk failure.