The shmem restoring code used to be scattered between criu and restorer, but after Andrey's patches using memfd it's no longer such. Clean the code a little bit localizing it in shmem.c. Also fix not-yet-fired BUG with patch #2 :) Thanks, Pavel