Fix check for cwd/lr.Dir being set

An empty cwd will currently cause the child process to exit with status 1. This patch makes it ignore empty cwd.