Remove the socket from poll if it has been closed

This prevents polling on file descriptors that are no longer in use
or have been reused for something else.

https://bugzilla.gnome.org/show_bug.cgi?id=723655
Test /socket/connection-close-with-pending

Test that closing a GSocketConnection with a pending read on the
input substream causes the read to terminate with the correct error.
This might not be the case without the preceding GSocketSource fix,
if the file descriptor has been reclaimed by another kernel object
that does not poll ready.

https://bugzilla.gnome.org/show_bug.cgi?id=723655