[CXF-5730] Calling Server destroy when thetext is destroyed, applying a slightly modified patch from Florian Léger