make database registry thread safe (for implementations without gil)