Add explicit cast to setsockopt() calls

Implicit cast from size_t* to const char* throws an error on some compilers.