There are also a couple of potential risks in the existing logic:
A potential race condition when checking if the counter was running
There is no limit in the number of gorutines that could be spawned to initialize the counter: holding the enter key over a password entry begins spawning goroutines without control that could result in a crash of the application or even the OS.