Hack to keep working with GTK < 3.12.

It seems that GTK deprecated the old functions and introduced the new
ones in a single release. Since the deprecation warnings break our
build, hack around this with an #ifdef.