Fix a rich text box resource leak

This fixes CID18360