stdatomic: Implemented legacy __sync APIs and __atomic_exchange_n
stdatomic: Implemented legacy __sync APIs and __atomic_exchange_n

These APIs are used when the architecture doesn't have atomic
instruction support

Closes https://github.com/espressif/esp-idf/issues/6463

espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf