shm: Use memfd_create when possible

It doesn't require shared memory dir and thus allows
to avoid cases when this dir is detected incorrectly,
as in

Signed-off-by: Alexander Volkov <>
2 jobs for master in 2 minutes and 27 seconds (queued for 41 seconds)
Status Job ID Name Coverage
  Docker Image
passed debian-testing #116617


  Build And Test
passed build-and-test #116618