Use Sbt transactional classfile writer

This PR brings the IDE in line with Sbt default behavior. A couple of cleanups on the way (see individual commits).

This PR builds on #668.

Fixed #1001953. /cc @gkossakowski