GRILL-582: closing cli closes underlying grill session

Also, Call the same close() function from both close command and shutdown hook.