Fix missing headers on some systems.

Thanks to Henner Zeller for the patch!