Fix dead lock while running message callbacks