gatomic: Use new __atomic_*() intrinsics for all atomic operations

Previously we used the old `__sync_fetch_*()` intrinsics for some of the
atomic operations, such as `g_atomic_int_compare_and_exchange()`. When
available, use the new `__atomic_*()` intrinsics for those instead.

As with the rest of our use of `__atomic_*()` intrinsics, we use the
`__ATOMIC_SEQ_CST` memory model. If people want to use a less
restrictive memory model to get better performance in certain
situations, they can use the compiler intrinsics directly themselves.
`g_atomic_*()` aim to be as fast as possible while remaining general
purpose.

Tested using:
```
meson test --repeat 1000 atomic atomic-test
```

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1750
13 jobs for 1750-more-atomic-intrinsics in 14 minutes and 9 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
failed #443852
cross-android_api21_arm64

00:01:08

failed #443853
cross-android_api28_arm64

00:01:04

passed #441020
cross-mingw64

00:03:10

passed #441016
debian-stable-x86_64

00:02:14

passed #441015
fedora-x86_64

00:04:18

passed #441017
G_DISABLE_ASSERT

00:03:45

passed #441021
win32
msys2-mingw32

00:12:55

passed #441022
win32
vs2017-x64

00:09:27

failed #441018
cross-android_api21_arm64

00:01:19

failed #441019
cross-android_api28_arm64

00:00:56

 
  Coverage
skipped #441023
coverage
 
  Analysis
skipped #441025
scan-build
skipped #441024
allowed to fail
valgrind
 
Name Stage Failure
failed
cross-android_api28_arm64 Build
[42/447] Linking static target subprojects/proxy-libintl/libintl.a.
[43/447] Linking static target glib/pcre/libpcre.a.
[44/447] Linking static target glib/libcharset/libcharset.a.
[45/447] Compiling C object 'glib/gnulib/101df56@@gnulib@sta/vasnprintf.c.o'.
ninja: build stopped: subcommand failed.
Uploading artifacts...
_build/meson-logs: found 2 matching files
Uploading artifacts to coordinator... ok
id=443853 responseStatus=201 Created token=3zYtsybR
ERROR: Job failed: exit code 1
failed
cross-android_api21_arm64 Build
[45/447] Compiling C object 'glib/4430778@@glib-2.0@sha/gbitlock.c.o'.
[46/447] Compiling C object 'glib/4430778@@glib-2.0@sha/gregex.c.o'.
[47/447] Compiling C object 'glib/gnulib/101df56@@gnulib@sta/vasnprintf.c.o'.
[48/447] Compiling C object 'glib/4430778@@glib-2.0@sha/gbookmarkfile.c.o'.
ninja: build stopped: subcommand failed.
Uploading artifacts...
_build/meson-logs: found 2 matching files
Uploading artifacts to coordinator... ok
id=443852 responseStatus=201 Created token=4xNzDmdL
ERROR: Job failed: exit code 1