Added missing freeing of GPU memory to the 'tolerance reached' and 'divergence' exit conditions of the clean_2d_c function