only use atomic counters when they are provided by boost

Change-Id: Ib9c76c9cfa3eab6718b9ce135c2b25fa2b813618
Signed-off-by: Alessandro Salvatori <sandr8@gmail.com>