fix calculation of average session memory

WOStats page did show wrong or even negative numbers
better naming of method
track thread names for warn traces
minor fixes
Merge branch 'refs/heads/statistics_patch' into integration_origin