other fix on WaitSemaphore and on sandbox

Change-Id: I504a993759b7084fc6941d58ed284ca65adffc0f