Ruby Timeout.timeout replacement using only 2 threads