Ticket #51: add multiple threads to BDB

Change-Id: I01cdc92a7cdb913add34ddd815251413e504e912
Reviewed-on: http://naan.mimuw.edu.pl:8001/124
Tested-by: Nebulostore Nebulostore <nebulostore@gmail.com>
Reviewed-by: Grzegorz Milka <grzegorzmilka@gmail.com>