Issue #2328493 by piepkrak: Async behavior of wysiwyg plugin attach/detach leads to some media tags not being replaced in time