support iOS(naming semaphores) and Android(unnamed semaphores)
Fix minor performance regression

The extra branches around semaphore use turned out to be surprisingly
expensive, so this eliminates them.
Fixup whitespace
Merge branch 'di3online-master'