session: Fix session free checks