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

(cherry picked from commit c9f6de94de2a4c7818e55a4207c5f85d6b21f0fa)