test: add exception handling to some scripts

Add exception handling to 'enable-modem' and 'list-modems',
so that they don't crash when ofono isn't running and/or
hasn't completely initialized.

Tested on mako running image #217.