Koreas agree to defuse crisis