Stop leaking sock descriptors in error path.