DERBY-6554: Fix some bugs in cache management for sequence generators; commit derby-6554-01-ad-bugfixes.diff.

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