gmem: Only evaluate pointer argument to g_clear_pointer() once

The new typeof() macro version of g_clear_pointer() was evaluating its
pointer argument more than once, meaning any side effects would be
evaluated multiple times.

The existing (other) macro version of g_clear_pointer() was evaluating
its argument exactly once. This mismatch could have confused people or
lead to subtle bugs.

See GNOME/glib#1494.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
11 jobs for g-clear-pointer-no-side-effects in 15 minutes and 49 seconds (queued for 18 seconds)
Status Job ID Name Coverage
  Build
passed #88690
cross-android_api21_arm64

00:02:03

passed #88691
cross-android_api28_arm64

00:01:42

passed #88692
cross-mingw64

00:02:11

passed #88662
fedora-x86_64

00:04:45

manual #88668
freebsd-11 allowed to fail manual
freebsd-11-x86_64
passed #88666
win32
msys2-mingw32

00:08:10

passed #88667
win32
vs2017-x64

00:05:58

failed #88663
cross-android_api21_arm64

00:01:41

failed #88664
cross-android_api28_arm64

00:02:02

failed #88665
cross-mingw64

00:01:27

 
  Coverage
passed #88669
coverage

00:01:41

73.3%