[libc] prefer *at syscalls in sys/stat wrappers (#197940)

- These changes flips the #ifdef order to prefer the *at syscalls over
normal ones.
- In modern architectures, *at system calls are preferred over normal
system calls cuz of safety issues.
- So by checking for ""*at"" system calls first, we ensure better
compatibility with modern systems.
- After then normal syscalls moved else or elif for support to older
ones.
  - From merged pr(#195792) and issue(#195620)

---------

Signed-off-by: udaykiriti <udaykiriti624@gmail.com>
Co-authored-by: Jeff Bailey <jbailey@raspberryginger.com>
GitOrigin-RevId: af0b42d8a5b0dcfacf958a2267855ce25002675f
6 files changed