Upon loading of the firmware, the user is informed that he needs to read
the license and has to agree to it by setting a loader tunable in his
/boot/loader.conf (see the iwifw(4) manual page for the whole story).

* Adjust read_xml() to allocate just the right size of memory, so we
don't waste anything by allocating 12 MB per client, when the usual
client xml is a few kB.

* Detach threads so that they can free resources whenever they return
from their startup function.

* Release the memory associated with a particular iterator and with some
of the fields in the event filters, which were previously leaking.

* Let the monitor thread check every few (2) seconds if the underlying
connection is still alive. Previously the threads were staying around
even after the connection was closed when no event (attach/detach)
occured.

* Clean up the pdev array on a clean exit so it's easier to find memory
leaks, since the amount of allocations done by proplib on behalf of
the pdev stuff is huge.

* Incidentally, don't forget to update the pdev array when a device is
detached.

* Change the visibility of some function prototypes in devattr.h to be
only visible from within libdevattr (or when LIBDEVATTR_INTERNAL is
specified).

* Stop wasting memory when reading the socket. Since we receive the size
of the remaining data first, we can allocate exactly the right amount
instead of wasting it big time by allocating 12MB no matter what.

The samba kernel-side daemon smbiod is created with
kthread_create_compat().

Kernel threads created with kthread_create_compat() have no td_ucred, as
other kernel threads, but have td_proc != NULL because this function
under the hood forks the process 0.

prison_replace_wildcard() was assuming that if td_proc != NULL it is
dealing with a user thread that has a valid td_ucred thus causing a NULL
ptr dereference when operating on kthread_create_compat()-threads.