Merge pull request #71 from gordon/windows

use _mktemp if _mktemp_s is not available
use defined (_LP64) || defined (_WIN64) everywhere