Unfortunately, I must correct myself.
The issue isn't solved by doing this.
If someone is logged in at the time the maintenance is run, the server hangs. In the log file, it looks like the user ran the maintenance himself (even when he 100% did not).
Can I assume that this is not intended behavior and report it as a bug?