improved the way of getting the home directory, to be more flexible for openelec