cmake: Only do Java tests when unit testing on (#2551)
Right now, we are adding the Java tests even when we are not building
unit tests. This commit changes the build system to only add the Java
tests when unit tests are enabled. There are two reasons for this
change:
- building a production version of CVC4 should not require JUnit
- it seems more intuitive (to me at least) to disable JUnit tests when
unit tests are disabled
This change also simplifies building the Java bindings in our homebrew
formula.