[IMPR] Use different logfiles for multiple processes (Step 2)
[IMPR] Use different logfiles for multiple processes (Step 2)

Use different logfiles if multiple processes of the same script are running
to prevent WindowsError/PermissionError when renaming a file. This also
prevents having different mixed logs in the same file.

- if config.logfilename is used this will be kept unchanged
- otherwise the logfilename is changed from <scriptname>-bot.log
  to <scriptname>-<pid>-bot.log if PID is not 1

Bug: T56685
Change-Id: I38937c3060d4653d1ffe8a8d9b918a8548907ab0

wikimedia/pywikibot-core,wikimedia/pywikibot-core