String#index given Regexp past end of string should return nil.

Fixes #1087.

See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/23660

and the commit that fixed it: https://github.com/ruby/ruby/commit/6a3931e0f630f56d4acd2b232f58c0225f03f52b