command-line: Make proctitle changing commands thread-safe.