Fix segfault bug in shmseg_shmat, remove automatic reference on
attach, cleanups in scache handling.