Fix suspend/resume API test that was flacky.

This test was relying on sleeps to ensure that it would have time enough
between the title reads. That was a wrong assumption. As it uses a
ForceRepaint as client this test must be driven by forceRepaint() calls.

These calls in conjunction with requestAnimationFrame (on HTML side) ensure
proper UI updates and correct title reads. A forceRepaint() was added before
suspend to ensure UI update before scripts got suspended. This was enough
to correct the test.

Reviewed by: Rafael Brandão.