[ARCH] Replace atomic testnset operation with cmpxchg operation

The atomic compare-and-exchange operation always returns
previous value of the atomic variable. If the returned
previous value is same as expected compare value (or old
value) then operation succeed else it failed.

As per above, we can easily express atomic test-and-set
operation in-terms of atomic compare-and-exchange operation
hence atomic compare-and-exchange is more generic.

This patch replaces arch specific test-and-set operation with
arch specific compare-and-exchange operation so that derive
more atomic operations using atomic compare-and-exchange.

Signed-off-by: Anup Patel <anup@brainfault.org>