BZ-1061217 - Per Process Instance and Per Request do not remove ksession from db

(cherry picked from commit a9de19477bb210514e96f2edf42d725cd6f4de60)