connection: Clear fds we shouldn't close to -1

This initializes all the fd arguments in closures to -1 and clears
them back to -1 when they've been dispatched or serialized.

This means that any valid fd in a closure is currently libwayland's
responsibility to close in the case of an error.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
1 file changed