Fix crash if str_ref(NULL) is called with --enable-valgrind.
Make parameter checking in vfs_get_metadata() consistent.
Work around GTK+ 3.12 brokenness.