Switch Promise to use cond var, not JVM semaphore.

A condition variable is a much better construct to be using here,
especially when a semaphore granting many permits is not portably
available.
Move Promise to src/core/, now it's portable.