Fix use-after-frees in unix_platform.hpp
Fix use-after-free in osx_platform.cpp
Fix bug in UnixPlatform::path()

It wasn't using the result of the call to realpath().
Fix signature of WindowsPlatform constructor
Remove instances of weird string(ptr).c_str() pattern