Make SchemaCache idempotent for constraints.

During recovery we re-create any constraints that were added during
potentially un-applied transactions. When we fill the cache after
recovery, constraints added by a recovered transactions will already be
in the cache so we must avoid duplicates.
Test to trigger recovery of schema transactions.

This test exposed a bug in SchemaCache: after recovery the database
would report duplicate constraints.
Don't care about order of constraints.
Merge pull request #1617 from apcj/2.0-schema-cache-idempotent

2.0 schema cache idempotent