Do not wait indefinitely to avoid race condition

Signed-off-by: Jorge Ruesga <jorge@ruesga.com>