core: fix some #includes to be posix compliant
sys/poll.h and sys/fcntl.h are GNUisms and might not exist on
strictly posix compliant systems. This fixes to use the posix
specified standard locations of these headers.
E.g musl c-library will give warnings on using these non-standard
glibc 'internal' headers.
(cherry picked from commit 2c74ba02c843349a6ad30f7e668a7a194dac679c)
(cherry picked from commit ad169fc1c3a207670c4f3615258e3637127982d5)