fix stackoverflows in queue when using synchronous tasks - WARNING, this slightly changes order of events when queue processing using sync tasks