of_strdup: Add explicit cast for C++ compatibility