[r=Eugene.Juravlev] fix OOME caused by increase of indexed file above indexed limit (RUBY-12980)
(cherry picked from commit afed234)