Close input/output/internal connexion

The resources closing was forgotten, it was not possible to use the program several times in the console