DERBY-6559 A immediate Fk constraint blows up iff its referenced PK is deferred and we delete a duplicate

Patch derby-6559 changes ReferencedKeyRIChecker to omit checking
dependent tables iff the referenced key is deferred and has rows with
duplicate keys one of whom is attempted deleted. So, in effect, the
check in such a case happens only if the row is "the last of its
kind", i.e. the last row having a particular referenced key. Added
tests for this behavior. To determine whether we have duplicates, we
open an extra scan on the index.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1593557 13f79535-47bb-0310-9956-ffa450edef68