don't output newlines when only showing node IDs

I often use the output of knife search -i and pipe it into other shell commands. However since it prints an additional newline after every host I always also have to pipe it through `sed -e "/^$/d"` first. Since the newlines don't help much when only outputting the IDs I added a conditional to not add them when using `:id_only`.