Fixed fclose() on stdin, stdout and stderr