clear a cached syntax object

Another potential (but minor in practice) leak
fix a leak related to submodules

The leak caused compile-time environments to be retained until
the next module complation, so it doesn't affect much.