[network] Fix minor resource leak. Fixes: CID#1230273

Free the network interface name in case it does not exist,
so it does not get overwritten by the next possible interface.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
[usb setting logic] Do not check for mode_to_set_twice Fixes: CID#1230272

In case we compile without devicelock support the old code already checked
for a mode to set. However this meant the secondary part of the loop got never
reached. Now we check in one place. No more dead code. Also we cleaned-up a
minor mem leak at the same time, as the mode_to_set did not get cleaned-up in
case it matched the current mode.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>