Limit concurrency for a function returning a promise.