Share a createUniqueEntity implementation between unix and windows.

The only extra bit of functionality that had to be exposed for this be be
implemented in Path.cpp is opening a file in rw mode.