[Issue-1556] - Dir.home should first try to return the path defined in HOME

Dir.home should point to the path defined in HOME and if it's nil then
it should point to path defined user.home and if both are nil then
should point to the path defined in LOGDIR.