Fix build with OPENLDAP and gdbm-compatibility.
PR: 204140, 207687 Submitted by: Lawrence Chen <beastie@tardisi.com>