QNX: Make the device discovery agent more robust

Also fixes the autotests.

Change-Id: I71983fa3cc49a88bb7b94544b7f24bebbd3cf86e
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>