Fix relative mouse motion event handling

Multiple mouse motion events can arrive during a single input sample;
combine the relative motion of all of the events rather than dropping
the previous movements.