python: Put connect_device() to util.py