Correct user's home directory detection (windows compatibility for ruby >= 1.9.3p362)

We could use Dir.home instead of this code, but it will not be compatible with old rubies