Port Linux shared memory to BSDs and macOS
Passed stc:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 13536 W: 3564 L: 3299 D: 6673
Ptnml(0-2): 20, 1334, 3810, 1569, 35
https://tests.stockfishchess.org/tests/view/6a6dac3ac054e285ae029b30
Pretty straightforward port. Just need to work around the lack of close-on-exec in various places and replace `memfd_create` with a tempfile/unlink.
Notably on macOS, `tmp` is disk backed (it's a symlink to `/private/tmp`), so this temporarily takes up ~110 MB of disk space, but it's unlikely that anything will actually be written to disk.
closes https://github.com/official-stockfish/Stockfish/pull/7016
No functional change