Simple readers-writer lock in Ruby