Fix memory leak in ioctl_tree_read()

If getline() fails it still allocates a line buffer which we need to free.
Arguably a glibc bug, but let's free it here to satisfy valgrind.