Fix crash with libdib >= 0.9.0

Based on a patch provided by Colin Law