Remove disable flag from grammar cache

Instead of internally maintaining state whether grammar caching is
enabled, remove state flag and set grammar cache only when needed.