common.gradle: change output directories

This is needed so that we can get IDEA to use gradle's outputs: it cannot be
configured to have different directories for classes and resources.