backport to 3.1.x [TIMOB-14206] Fixed Database ResultSet crash on close