Moved constraint index validation into prepare phase of constraint creation.

This removes a race condition where changes could occur between validation and
commit. Now we are protected by the synchronization on prepare/commit.