Added option to limit thread tasks to curb memory consumption

Added the option to limit the number of pool tasks to ensure there is not continual message consumption by in-memory Thread::Pool::Tasks. Currently the master thread will continually create tasks so long as peak returns a positive integer. These tasks can easily overrun and compound the worker pool and result in ever increasing memory consumption. 
I added that because I was running into ``lock': can't be called from trap context` exceptions and after a quick googling i found that worked as a quick fix. I can remove the change if needed.