Fixes text selection in UITextInput when cursor is out of the box

Hi Ivan,
This pull request fixes issues #537 and #549. When the mouse was moved out of the text input (one and multi line), the mouse up event had not any effect because it takes place in the core and not in the text input. I just tried in Linux but I suppose that works fine in any OS. If you have any question/suggestion, here I am :)