Issue 50152 - Replace os.getenv('HOME') with os.path.expanduser
Description: When HOME env var is not set, the call will fail with an exception.
Instead of HOME we can use expanduser method. The expanduser will do the right thing
and get home directory on all platforms from either env vars or password database.
https://pagure.io/389-ds-base/issue/50152
Reviewed by: mreynolds, wibrown (Thanks!)