[usb-moded] If there is no mode to set, fallback to charging

Also re-order code a bit so we fix a potential null dereference.
Fixes: CID #1103634

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Potential fix for CID #1103635

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