Fix up the new expand_user method.

quoting anywhere in the user_home_path interferes with shell expansion
so we have to check it for validity ourselves.