Move syscall.Stats logic to os specific file.

related to #2909.