initial support for waiting for a device to reconnect with --stay-connected

fixes #6