Fix flaky test in TransactionIT closing socket to terminate transaction.

The test will now allow some time for the socket closing to propagate
network stacks and actually have an effect. It is a speculative fix.