Sort rules numerically

Each iptable rule defined in reclass has its own numeric rule ID.
These rule IDs are used later when iptables rules in plain text
are generated.

Unfortunately, it turned out that these rule IDs are stored as
string values internally, so we've got wrong ordering when doing
sort / dictsort.

This commit casts keys to numeric, creating a copy of input dict.

Related-Prod: PROD-25163

Change-Id: I4d9d726c1ae6588e7be2aac3fad0de64f5dc2d9c
3 files changed