open-babel: fix build with libc++

Backport of upstream commit, allowing libc++ to work with Open-babel 2.3.2

Fixes #23831.
Fixes #28108.
Closes #27264.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>