Revert "Port __sync atomics to pthread atomics"

This reverts commit 197995e18ba04543078556972afbca5daf228cd5.

This fixes runtime failures on PC seen when using the image backend or
writing images to disk.  The bug exhibits itself with errors about
invalid SkBitmaps and 0x0 bitmap allocations.

Note that this was added to fix problems on Tizen, so a followup patch
will be needed to restore working behavior on Tizen.
Link against gcc's intrinsic atomic functions.

This fixes crashes on Tizen M0 devices that are triggered
when running the caskbench testsuite.  The bug can be seen when running
caskbench's skia-mask test case, among others.

Patch from Suyambulingam Rathinasamy Muthupandi