avl: Add abstraction to search and dtor to delete

Previously the search would return a tree node. Now however, the code
has been rewritten to only return the data field. This is to prevent the
user from tinkering with the tree internals. If they desire to do so,
there is a pointer in the tree descriptor.

A destructor option has been added to deletion and flushing. Previously
there was no real elegant way of telling the tree operators what to do
with the data, once the node was to be thrown away. Now using the
destructor, we can just specify it using a callback.

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>