lbdb: fix compilation on Mountain Lion and Mavericks

Apply three patches from chrisbarrett/lbdb to fix compilation
on Mountain Lion and Mavericks

Closes #24761.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>