Fix multiple-init race
Increment counter after init has finished
Guard against shutdown/init races