configure: fix mktemp test and fallback function