Fix #2300: deal with the case where there are no writable directories.
Merge pull request #2300 from mdboom/fix-get-home

would crash if get_home() returns None