backend: don't modify logger record in handler
This is a bit unexpected Python behavior, but any change to the log
record in one log handler affects also later called handlers. Since we
need to modify the log record before we emit it, let's copy it and
modify only the local copy.