Added rb_io_check_io to the C API.

See #2771 for more info.
Added specs for rb_io_check_io.

See #2771 for more info.