lwinput: Move file extension checker into common directory.