fix mutex wait test to avoid thread timing issue