BZ-1044529 Memory leak (caused by kbase.getStatefulKnowledgeSessions()) (cherry picked from commit 4304d2305e4e15693613c1d9ad00147772a1ac9b)