CA-146822: fix intermittent test failures
CA-146822: fix intermittent test failures

As the lock test was querying the GC for the collected locks, it might
be possible that when the test starts, there is already an uncollected
lock in the GC. To avoid this situation, run the GC, so only the garbage
created by the test will be collected.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Reviewed-by: Flavien Quesnel <flavien.quesnel@citrix.com>
Imported-by: Thanos Makatos <thanos.makatos@citrix.com>

(cherry picked from commit 02ac5351c01aaa8806c4c5a26717fc5a47cd605d)

siddharthv/sm,germanop/sm,djs55/sm,germanop/sm,kostaslamda/sm,germanop/sm,martinjorge/sm,BobBall/sm,chandrikas/sm,martinjorge/sm,kostaslamda/sm,djs55/sm,pritha-srivastava/sm,BobBall/sm,djs55/sm,robertbreker/sm,malcolmcrossley/sm,robertbreker/sm,chandrikas/sm,siddharthv/sm,BobBall/sm,kostaslamda/sm,siddharthv/sm,chandrikas/sm,xapi-project/sm,malcolmcrossley/sm,malcolmcrossley/sm,pritha-srivastava/sm,robertbreker/sm,pritha-srivastava/sm,xapi-project/sm,martinjorge/sm,geosharath/sm,geosharath/sm,geosharath/sm,xapi-project/sm