DERBY-5163 [patch] fix up sql cleanup handling Contributed by Dave Brosius. Merged 1098040 from trunk to 10.8