Recursive events and simultaneous calls from multiple threads cause assert