Fix `mkstemp` error handling
In !198 (merged) the mktemp
invocations were replaced with mkstemp
. During review it became clear that all these invocations either have incorrect error handling or lack error handling completely. This should be fixed.
Edited to add: it has been noticed here: !701 (comment 879898455) that mkstemp() returns an open fd. This should be properly used or disposed of.
Edited by Ralph Little