TS-1470: Fix cache sizes > 16TB (part 2)

The first part allowed you two create a cache larger than 16TB,
this second part fixes a subsequent bug that clears a large
cache on restart.

backport of: 61496440b65ee28c93bf77fa036c0424b33dc10c
test/review: igalic, arno, zwoop
backport: sorber