Bug mp1 2467 when typing a password with the virtual keyboard the sms style is disabled

This is without refactoring, but with fixing a resource leak