avoid NPE in case session was already properly destroyed on some containers

(cherry picked from commit 54f11d2c19d57d74dea755ce9657fbb1443a448c)