Fix temporary file creation on linux and build for 3.5