Remove race conditions seen in multi thread testcases.
Remove race conditions seen in multi thread testcases.

ibm-genwqe/genwqe-user,ferseiti/genwqe-user,ibm-genwqe/genwqe-user,tblume/genwqe-user,tblume/genwqe-user,ibm-genwqe/genwqe-user,ferseiti/genwqe-user