Mutex and Condition variables which are part of enif suite seems to
be loosing signals on condition variable and thus puts both consumer
and producer into sleep simultaneously resulting in deadlock.
These mutex and condition variables are replaced by C++ stl counterparts.
Also since we do map_doc serially for one document after another there
is no much gain if we increase queue size, so setting it to 2 now.
Benchmarking with unit tests also confirm this. Later if we do parallel
map_docs we can set the queue size optimally.