sockfilt.c: Reduce the number of individual memory allocations

Merge multiple internal arrays into one, even if some variables
will not not be used. They are all created with the number of
file descriptors as their size.

Also fix possible thread handle leak in CloseHandle-loop.