[Bugfix] Fixes double release of GridPtr that caused segfaults.

Unfortunately the last bugfix patch introduced a bug for all other
grids apart from parallel UGGrid as the GridPtr was released twice
and the null pointer returned from the second release was used for
all tests. This patch fixes this.