use ccache in the nightly builds
Automatically use ccache in the nightly builds, if we are not building for a release and the environment variable CCACHE_DIR is defined.
For CMT we still not use ccache because we need LBCORE-953.
Fixes LBCORE-637.