Improve cache size calculation of PCode objects in general.

Also trick the RAM cache manager to set a low cost on entries coming
from persistent storage.