session: fix response hang when no session to write