trace: remove use of global state in fetch_and_inc_if_less()

The function was accessing _active_cpus when it should actually access
input variable 'var'.

Reported-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>