cache: define cache paths and GBUILD_CACHE_ENABLED conditionally

Follow-up of 66015b9f14387295de4b8850097e510578cac651. This will allow build-scripts to detect caching, so they can continue to work with older gitian versions. Sorry for not including it in #71.

This really should be the last change needed for Bitcoin's cache usage.