base: check cpu_session pointer during destruction

Issue #1122
run: limit created threads in test

The rm_session quota of the context area is not sufficient to start more
then ~95 threads per address space. If one really needs so many threads per
address space one could increase the quota or dynamically respond to it using
the Expanding_rm_session class. Until now there is no need to support so much
threads per address space.

Issue #1122