Fix uniqueness validation to correctly work with STI

Currently, uniqueness validation check is done by calling `resource.model.first`, which only scopes the query to that particular class.  This patch uses `property.model` instead to scope the query to the class in which the property was defined and its children.

This is the best solution that I could find.  There is no easy way to scope the query to the class which calls `validates_uniqueness_of`, only the class that defines the property.