[3.0] extras/tools: add /dev/stdin to sha512sum command
This is needed with the sha512sum introduced on recent macOS versions and matches what is already done for contribs too.
(cherry picked from commit 2564699f) (rebased)
rebased:
- the code around is slightly different