Fix testsuite memory leak and synchronisation problem

* Do not leak a new BBitmap, return the existing one instead (a copy is
already created by the caller)
* Synchronize the offscreen view before getting the bitmap.

This avoids the testsuite pixel tests to get out of sync, comparing the
bitmap from the previous test, or an half-drawn one.