fix bug for get_valid_iv_sym

When sub-string is used in the following way, it does not work well.

```ruby
o = Object.new
o.instance_variable_set(:@a, 1)
o.instance_variable_defined?("@abc"[0,2]) #=> false (this should be true)
```

Thanks @tsahara for providing an  example.