win: Make sure changes to global handles array won't affect the wait function.