Input: fix input_free_device() implementation