fix deallocation bug

we have to make sure that the grid and the time manager is still
allocated when the destructor of the problem is called. this fixes an
issue with test_adaptive2p2c. (and any other problem that makes calls
to the grid in its destructor. I'm pretty sure calling the grid in the
problem destructor is bad practice, but it should definitely not lead
to crashes.) Problem was found using address-sanitizer.