This fixes some long standing deficiencies in error handling,several race conditions and disconnect handling.Finally a cleanup as we now can get the device easilyfrom the interface.