[Core] Fix potential nullptr dereference in addRule
[Core] Fix potential nullptr dereference in addRule

Duplicate rule registration could trigger nullptr dereference now that
rules are passed as unique_ptr.

rdar://problem/58566350

apple/swift-llbuild,apple/swift-llbuild,apple/swift-llbuild,apple/swift-llbuild,apple/swift-llbuild,apple/swift-llbuild,apple/swift-llbuild