Make project close and plugin shutdwon save (scala) project-specific preference stores as well.

Fixes #1002304