Add task count limit to requests in the queue
By default, the number of running and pending tasks cannot exceed 3. New
requests are immediately rejected if the queue is full.
Also, get rid of the EventEmitter as it was adding unnecessary complexity.
Bug: T178501
Change-Id: Id723d45d23878e581872551f908cea60e4999bd2