Don't require glib 2.40
More consistently include config.h
configure: Set glib min requirement to 2.32

and warn when using newer APIs
Replaced various uses of malloc with glib versions.

glib versions abort() on failure, so checking the result for NULL is unnecessary.
Use glib for allocations in all plugins
Fix building as c89