corrections to caching logic (wrong sma used for third parties)
further corrections/consistency in headers/declarations
only declare volatiles we need in apc_cache.c