debug/io-stats: Fix races and performance issues in profile
debug/io-stats: Fix races and performance issues in profile

Fix the race in update_latency and memset of interval stats.
Update fop hits and latencies only when both the options are set.

Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Vijay Bellur <vijay@gluster.com>

BUG: 2636 ("profile info" lists 'nan' in latency when heavy i/o is running)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2636

Kaushikbv/Gluster,Kaushikbv/Gluster,Kaushikbv/Gluster