Lock source poll

Make source polling thread safe to ensure that a message cannot be added twice (resulting in two docids for the same message id). Hopefully fixes issue #68.

A potential annoying side effect is a unlikely race condition where a newly sent message is not added before the next poll is done. This could be changed by not doing try_lock, but lock. Which in the vast majority of the cases would result in an unnecessary double polling of the sent source.