Terminate the console before freeing its ressources.