socket: implement assignment operator

Avoids shallow copies which were causing segmentation faults in CCRTP
Merge pull request #41 from tmatth/fix_segfault

socket: implement assignment operator