mg_get_ports to return number of elements of ports and ssl filled in

* Return the number of elements of the ports and ssl arrays passed in,
  so that the caller knows how many ports the server is listening on/
  how many elements of ports/ssl are valid.