Fixed using unitialized variables in mouse button handling

See also: https://github.com/minetest/minetest/pull/1707

event.MouseInput.Event is not initialized if event.EventType != EET_MOUSE_INPUT_EVENT and the previous code didn't check that EET_MOUSE_INPUT_EVENT was indeed the event type before checking the MouseEvent (and it was therefore invalid/not initialized).