Update validateUniqueness to support custom primaryKeys.

We have some models that have some non-'id' primary keys and they were failing validations when we were trying to save them.

Not sure how to sign the CLA, but I don't have a problem with it.