fixed ifdestroy

Currently ifdestroy blocks indefinitely in pthread_join().
The file descriptor needs to be closed before the pthread_join(), since the receiver thread is probably blocked in poll() and will not unblock until the FD is closed and poll() returns with an error.
Another method would be to add a shutdown pipe to the poll FD set, but that is overkill since closing the FD aborts the poll anyway.
The above fixes the hang, but there is still a memory leak since closing the FD does not unmap the ring buffer. Once the thread has safely exited, the ring buffer must be unmapped using munmap().