Handling MAX_CACHE_SIZE=inf in megacarbon

Carrying over functionality from the whisper-based carbon branch, we need to handle cases where the user selects "inf" for MAX_CACHE_SIZE or other metrics. Current code in megacarbon borks loudly as valueType expects <type 'int'> only.