stat: speedup statistics update

Remove 3 system calls per update call.
This should greatly speedup startup and somehow improve insert/remove
times.

TODO:
Actually statistics cam be moved to separate thread almost removing
statistics overhead in expense of lower resolution.
misc: move includes to the top to unhide include errors