Cross platform way to get cache directory

As discussed in #102. The `HOME` env variable is not available in windows at all.