smalloc: cleanups and allow sfree(NULL)