Currently we don't bother to close slots on exit. This is no problem
but it causes valgrind to report a bunch of memory leaks. This patch
makes it close all writers, filters and receivers on exit.
To this aim, the cleanup part of close_unused_slots() is abstracted out
into the new close_slot(), which is now also called from clean_exit()
for each slot, just before para_audiod exits. In order to avoid
forward declarations, clean_exit() had to be moved below the two
other functions.