[qcoreapp] delete event before relocking mutex

Any access to the event loop initiated from event destructor will cause
deadlock because unlocker.relock() will be called earlier then scoped
pointer destructor. So, moving scoped pointer lower in a control flow so
destructor will be called earlier. Intermediate code is not influencing
control flow so it should be safe

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>