Socket and Clipboard bugfixes

In the process of adding a new element (pull request forthcoming), I've found and fixed some small issues with the Socket and Clipboard elements. The latter was missing a NULL check (shame on me), while Socket appears to have quite a bit of dead code and code that has no apparent function.

I'm a bit wary of be3dbd1 (Socket: Remove unused timer), in case I overlooked some interaction with the timer, but please have a look. :-)