Move _wait_for_pkgdb_unlock inside of PkgTest class