tests: Use "command -v" instead of which(1) in shell scripts