Remove mktemp dependancy

Removes mktemp dependancy by exchanging with $RANDOM because mktemp is not available when using msysgit.