Fixed minor issue.

Socket used to find the broadcast ip was not closed when there was
more than 16 broadcast interfaces.