added timeout to the loop

Same as for pebbles here https://github.com/crowbar/barclamp-crowbar/pull/805