Cherry-picked add-same-key-database-twice protection.
Make new add-policy compliant with RB4.