Validate uniqueness of queries by query/match_type.

This is the intended use of the system.  Behaviour when duplicates exist is undefined.