Add missing config.h to types.h

Without config.h the various HAVE_* macros are not used properly and
this causes a compilation error on OSX Mountain Lion.(cherry picked from commit e32f9ed4b811ba301022520122ea8dea70c65e57)