shell.c close() valgrind errors fixed