[kurento-test] Improved timeout/finish condition in threads

Change-Id: I7a025cae0745b98533301af82ec021259a9fa210