Fix race condition on layer enumerating on startup.

A race confition is present in redrawbackbuffer() code.
Especially on startup, it is possible that a concurrent thread changes
the list of layers when redrawbackbuffer is executing. The QReadLocker
used in layers() is useless in protecting that loop, because the list
of layers is accessed through a reference, not through a copy.
The fix involves protecting that loop with an external QReadLocker
and accessing the list directly, instead of using layers() that would
create a deadlock.