hotplug2: merge worker related fixes into one patch

Backport of r35856

git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@35858 3c298f89-4303-0410-b956-a3cf2f4a3e73
hotplug2: fix a memory leak and wrong variables leaking into the fork worker process (#12436, maybe also #12765)

Backport of r35857

git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@35859 3c298f89-4303-0410-b956-a3cf2f4a3e73