[BUGFIX] CLI tests have to explicitly exit the CLI in order to avoid hanging

#332