libnetapi: fix a C++ warning by making implicit cast explicit