input: Free the memory allocated to store the device resource lists

v2: Walk the array manually as wl_array_for_each is bytewise we're
storing pointers that we need to free.