rpc: Fix potentially segfaults
rpc: Fix potentially segfaults

We have to allocate first and if, and only if, it was successful we
can set the count. A segfault has occurred in
virNetServerServiceNewPostExecRestart() when VIR_ALLOC_N(svc->socks,
n) has failed, but svc->nsocsk = n was already set. Thus
virObejectUnref(svc) was called and therefore it was possible that
virNetServerServiceDispose was called => segmentation fault.  For
safeness NULL pointer check were added in
virNetServerServiceDispose().

Signed-off-by: Marc Hartmayer <7bafc8cd4e6394916d396e4f8cde69753be8d066@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <2648abdd55bfebf313fd324b464b047e6eea300e@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <40545c009452f40d2ae0bbfbd987b332d274d328@linux.vnet.ibm.com>

jardasgit/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,eskultety/libvirt,VenkatDatta/libvirt,jardasgit/libvirt,taget/libvirt,libvirt/libvirt,olafhering/libvirt,zippy2/libvirt,zippy2/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,jardasgit/libvirt,libvirt/libvirt,nertpinx/libvirt,eskultety/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,nertpinx/libvirt,eskultety/libvirt,taget/libvirt,jardasgit/libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,crobinso/libvirt,andreabolognani/libvirt,taget/libvirt,VenkatDatta/libvirt,libvirt/libvirt,jfehlig/libvirt,zippy2/libvirt,jfehlig/libvirt,taget/libvirt,datto/libvirt,eskultety/libvirt,datto/libvirt,olafhering/libvirt,VenkatDatta/libvirt,jardasgit/libvirt,andreabolognani/libvirt,zippy2/libvirt,fabianfreyer/libvirt,olafhering/libvirt,datto/libvirt,taget/libvirt,andreabolognani/libvirt,libvirt/libvirt,crobinso/libvirt,nertpinx/libvirt,nertpinx/libvirt,crobinso/libvirt,olafhering/libvirt,jfehlig/libvirt,jfehlig/libvirt,eskultety/libvirt,datto/libvirt,datto/libvirt,crobinso/libvirt,andreabolognani/libvirt