Use evutil_closesocket instead.
Add copyright and licensing files for CMake modules.
Only include WIN32 getopt where it is used.

getopt is only used in the benchmark tests, don't include it in the core
lib...
Fix bench_cascade program on Windows.