Create a concurrency-constrained copy of an asynchronous javascript function.