build-sys: use linux/memfd.h if available

linux/memfd.h was added linux 3.17, so it might not be widely
available for a while.

Also, check if memfd_create is defined, for the HAVE_LINUX_MEMFD_H
check to have a chance of succeeding.

Also, collapse all ifdefs for memfd-related stuff, because they
were all added together so there's no need to check separately.