fix POSIX shared memory support, conditioned by --enable-posix-shm

* Probe for POSIX shared memory after probing for SysV IPC because
  otherwise SysV IPC always takes over.
* Only do this if --enable-posix-shm was passed to configure.
  This is to maintain backwards compatibility with before this change
  when the probe was never effective.
* Fix apr_shm_attach for when POSIX shared memory is used.
* Encode the shm name passed to shm_open and shm_unlink to comply
  with the functions' requirement on the format.  Without this,
  apache httpd fails trying to create shm with slashes in the name.