libinput: fix and optimize build