Fix firewall rule ID generation

All rules in a firewall were getting the same rule ID due to an
order of operations bug.