Fix #515: socket: excessively sparse array

This patch adds __serialize hook to sockets to fix REPL && admin console.