Set HOSTFILTER only if TARGET_MACHINES is set. #10147
Fixes bug introduced in #10146 which broke all-nodes deployments.
Tested by applying the change on the Integration Jenkins and running an all-nodes and a single-node deploy. In both cases it selected the right nodes as well as the job succeeding.
I also verified that the conditional does the right thing for