Fixed a bad cleanup of IOLoop when stopped. Also added test for IOStream:read_until method.