Title: #959: tests: fix race confition in enumeration tests
This is combination of two patches originally written by @fidencio and @pbrezina.
This PR is a result of extensive discussions held in #947 and #956.
To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/959/head:pr959
git checkout pr959