SEA-1252: Memory leak with index schemas
(cherry picked from commit e1d0616)
(cherry picked from commit 6b18e75)