add safeTail and use it for built-in callback prims