A correct MPI program should do that.
As MPI_Finalize is part of the destructor of MainObject we need to
make sure that it's destructor is called before the return statement.
We do that manually by resetting the unique_ptr that we now use to
store the MainObject,