CA generator: improve locking
- If it is already locked, don't abort but wait for the lock to end.
- Store the lock file in /tmp, so a reboot wipes it naturally.
- Remove the generating file after locking, if it was left from before.
This is for #11 (closed).