locking, asm-generic: Rework atomic-long.h to avoid bulk code duplication