r/harness: Reduce scope of $cmd variable

Signed-off-by: Niels Thykier <niels@thykier.net>