Add input cleanup

What type is the `ws_input_ctx.devices` variable? A `ws_object_unref()` causes a `free()` behind the scenes when the refcount gets zero, you know that?