Dragging a number button, then holding the value and pressing escape
would not reset the value correctly.
This was because eb06ccc32462 assumed that data->value and
data->startvalue were set during dragging which they are not.
The fix moves the if statement into the section where we check if a
number was entered (number edit) making sure that we only cancel
if the button was in "string enter" mode and that the value entered
was the same as before.