make mktemp match the historic behavior, and update functions that use it