make the shm_open check POSIX conform

"If name does not begin with the <slash> character,
the effect is implementation-defined."
replace flock run test with a compile time test

Since AC_TRY_RUN will fail when cross compiling, replace
it with a compile time test. This does only check the order
of the member, as the name of the test mentions.
assume mmap is working properly when cross compiling

Since mmap functionality can not be tested with a cross
compiled executable, just mmap is working properly when
the function exists.
also set HAVE_LIBDL when it needs -ldl

if dlopen needs -ldl ac_cv_lib_dl_dlopen is set instead of
ac_cv_func_dlopen. Since the are more variants check for
lt_cv_dlopen not being no instead.