[DDMD] Fix mkstemp stuff to be valid D.

Instead of relying on the preprocessor, copy `P_tmpdir` and the template string into a buffer.