Memoryviews: Improved fix for the problem when GNU intrinsics fail on MinGW

** Allows GNU atomic intrinsics to be used if they do work (the common case).

** Uses Windows API atomic methods if they are unavailable.

** Python thread locking (implemented with slow kernel semaphore) is not used for refcounting memoryview buffers.