Issue 5243 - Avoid overwriting existing file on posix

http://d.puremagic.com/issues/show_bug.cgi?id=5243

**Note**: Leandro Lucarella requested a pull, but I don't have a DMD posix setup to test this on. Also I'm missing a test-case.

The basic idea of using `getuid()` was based on the RDMD implementation.