#9280: fix deleteLayer not called in thread without event loop

from Qt documentation:

void QObject::deleteLater() [slot]
...the object will be deleted once the event loop is started. If
deleteLater() is called after the main event loop has stopped, the
object will not be deleted. Since Qt 4.8, if deleteLater() is called on
an object that lives in a thread with no running event loop, the object
will be destroyed when the thread finishes.