add closedir to simpleshell commands that open directories

This adds closedir to free up the directory resources allocated by openddir