MediaEngineTests: fix race conditions in test for bgo#722731

Even with the race conditions, the test was actually doing well.
It was only when I started fixing other issues around PlayerEngine
when I began noticing the race conditions. So I'm fixing them
first before committing my further fixes.