core: fix crash related to core sockets_list  command
 - reported by Nuno Reis <nreis@wavecom.pt>