(#190) Fix edge case and add a test for it.

Without this patch, when facter is run in an environment where $HOME
is not set, it crashes while trying to expand_path "~". The patch
uses Ruby's ENV['HOME'] instead of "~", which sanitises the
expansion.