DERBY-534: Support use of the WHEN clause in CREATE TRIGGER statements

Move common logic for executing WHEN clause and trigger action to the
base class GenericTriggerExecutor. In addition to reducing code
duplication, the change makes row triggers reuse the prepared
statement for the WHEN clause (same as it already does for the trigger
action), and it makes statement triggers not leave the before and
after result sets open if the WHEN clause evaluates to false.

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