Ticket #55: Close threads created by BDB module

Change-Id: Id1ebcbd425775673659ab0b800b4257b142cb762
Reviewed-on: http://naan.mimuw.edu.pl:8001/128
Tested-by: Nebulostore Nebulostore <nebulostore@gmail.com>
Reviewed-by: Krzysztof Rzadca <krzadca@mimuw.edu.pl>
Tested-by: Krzysztof Rzadca <krzadca@mimuw.edu.pl>