Fix socket close timeout