Fix for BSD mktemp

`template` must be provided when using BSD mktemp.
Externalize slash in mktemp call as suggested by @ofavre

Also, using a descriptive name for the generated temp file.
Merge pull request #3 from siadat/patch-1

Fix for BSD mktemp, closes #3