Better support for $HOME in msys shells on Windows

If running in an msys shell, use the /home/embray environment variable set in that shell to find the user's home.  The surest way to determine this is if the MSYSTEM environment variable is set (it doesn't matter what it's set to).  Obviously this isn't foolproof but there are few better alternatives (one might be to try calling 'uname').

This specifically came up because some versions of msys (including the one I have installed) screw up the `$HOMEPATH` environment variable such that the `.astropy` directory ends up being created in `C:\.astropy` (if you even have permission to write there, if not it blows up).