Make shutdown and retry tests pass in celluloid driver.

Previously several tests in TextConnectionHandling and TestInternals had
been failing under jruby. Now more closely follow the behaviour in the
ruby driver.