compat: Move into a subdirectory

In preparation for splitting up compat.c, move it and the header to a
subdirectory.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lib/compat/: Split compat.c into smaller files

Instead of having one monolithic file for all compat functions, separate
them by topic (by function, except in case of pread/pwrite).

Signed-off-by: Gergely Nagy <algernon@balabit.hu>