Fix output formatting from iptables/netstat cmds

Currently tests checks that port is already used or
whitelisted in incorrect way, so sometimes verification
fails.

Change-Id: Ic80641a7819a046b6d14cde55f1e289aa20ac07a
Closes-bug: #1363077
Merge "Fix output formatting from iptables/netstat cmds"