4809. [port] Check at configure time whether -latomic is needed for stdatomic.h. [RT #46324] (cherry picked from commit e3d9aaff)