asynctypes-685526: Add util.synchronize
asynctypes-685526: Add util.synchronize

What do you do when a function may act synchronously or asynchronously
and when there are times when it is predictably synchronous. You could
return either a promise or a concrete value, or you could have a
consistent promise reply, which you synchronise like this. This could
turn out to be a poor solution, but we're experimenting with it for now.

Signed-off-by: Joe Walker <7a17872fbb32c7d760c9a16ee3076daead11efcf@mozilla.com>

mozilla/gcli,mozilla/gcli,mozilla/gcli,joewalker/gcli,joewalker/gcli