Fix thread-safety of constant caching in IR runtime.

This gets the spec for #999 working.
Raise proper errno in IO#sysread if possible.
Clean up JRUBY-3155 spec.