firewall: rules.pl: Sanitise source and destination IP addresses.

Those variables are now empty if source or destination are
unspecified.
firewall: Fix DNAT rules between internal zones.
firewall: rules.pl: Code cleanup.