Handle delete_text(start, end) when end is -1

The gtk implementation threats -1 as the end of the entry, we should do
the same.

Also, when calling set_text, simple call delete_text(0, 1) and
insert_text(text, 0) instead of reseting the mask. Reseting the mask
would call delete_text too, so this is simple and faster.

Change-Id: I51eb7520f017247c179583a41f573bcaa6968072