Use atomic instead of mutex to increment one integer

Another attempt to use atomic instead of mutex.
Seems like go lacks `getAndIncrement` so this patch changes behavior - now framework ids start with `1` instead of `0`.