atomic: check for __sun and use atomic.h and sun compiler intrinsics.