Clean up how we skip tests when a syscall isn't in the kernel.

The close_range() test in particular has been confusing a lot of
partners. I think the sys_epoll_test.cpp idiom is the clearest of the
ones in use, so let's use that everywhere. (I haven't actually touched
the SysV IPC tests, because if we do touch them, _deleting_ them --
since all those syscalls are not allowed on Android -- is probably the
change to be made!)

I'm on the fence about factoring this idiom out into a macro. There
should never be too many of these, and we should probably be removing
them? Is anyone still running the current bionic tests on 4.3 kernels
without membarrier(2), and if they are --- why?!

For now though, I haven't removed any of our existing tests; I've just
moved them over to the sys_epoll_test.cpp style.

Test: treehugger
Change-Id: Ie69a0bb8f416c79957188e187610ff8a3c4d1e8f
diff --git a/tests/sys_mman_test.cpp b/tests/sys_mman_test.cpp
index 9421565..e785ff4 100644
--- a/tests/sys_mman_test.cpp
+++ b/tests/sys_mman_test.cpp
@@ -279,10 +279,9 @@
   // Is the MFD_CLOEXEC flag obeyed?
   errno = 0;
   int fd = memfd_create("doesn't matter", 0);
-  if (fd == -1) {
-    ASSERT_ERRNO(ENOSYS);
-    GTEST_SKIP() << "no memfd_create available";
-  }
+  if (fd == -1 && errno == ENOSYS) GTEST_SKIP() << "no memfd_create() in this kernel";
+  ASSERT_NE(-1, fd) << strerror(errno);
+
   int f = fcntl(fd, F_GETFD);
   ASSERT_NE(-1, f);
   ASSERT_FALSE(f & FD_CLOEXEC);