Improve atomic memory access and support -mno-atomic.

Use CONFIG_GENERIC_ATOMIC64 if 32-bit.  Add system call to emulate
atomic compare exchange, primarily for targets lacking hardware
support (i.e., lacking RV32A, RV64A).  Support excluding use of
atomic memory instructions (-mno-atomic).

This change is mutually dependent on the corresponding change to
riscv-gcc.
To avoid a link error, this line should be guarded by `#ifdef CONFIG_RV_SYSRISCV_ATOMIC`.  If that is not feasible for some reason, at least define a stub for `sys_sysriscv()` in the case of `!CONFIG_RV_SYSRISCV_ATOMIC`.  For example:

```C
SYSCALL_DEFINE4(sysriscv, unsigned long, cmd, unsigned long, arg1,
	unsigned long, arg2, unsigned long, arg3)
{
#ifdef CONFIG_RV_SYSRISCV_ATOMIC
...
#else /* !CONFIG_RV_SYSRISCV_ATOMIC */
	return -ENOSYS;
#endif /* CONFIG_RV_SYSRISCV_ATOMIC */
}