Autodiscovery failure through search resolved

For unknown reasons, the search resource doesn't return results at
times. This patch fixes it by querying the service in loop unti
timeout.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>