A generic pool to limit number of running asynchronous tasks in node.js