Add and use ioctl_tree_free()

Add destruction of ioctl_tree objects, and use it in our preload library. Note
that this does not yet cover the destruction of the recorded ioctl_tree as this
might be used with several fds at the same time. This needs refcounting.