route/cls: add get/take wrappers for rtnl_act_append()

rtnl_act_append() either takes ownership of the argument, or does
nothing (on error). This pattern is hard to get right. In the past,
there were various bugs at this place.

Add two wrappers _rtnl_act_append_get() and _rtnl_act_append_take()
which consistently don't take ownership of the pointer or take it.

Also, in functions like rtnl_flower_append_action() only set the mask
after successfully modifying the data.
6 files changed