Refactor: libcrmcommon: Add io_internal.h
Separate internal IO-related functions into their own header file, for
better organization and future reuse.
Remove from internal.h the includes that are used only by the IO
functions.
Also remove sys/types.h include, since unistd.h provides everything we
need.
Closes T536
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>