temp filename also should be escaped

On Windows temp filename can contain spaces (for example, C:\Documents and Settings\Username\Local Settings\Temp\tmp568.tmp). In this case call of wkhtmltopdf fails.