Add more sophisticated logic to deal with various authentication_url values
other than full absolute URLs as suggested by Dennis McRitchie.
Minor differences to the original patch include enforced 79 char/line limit
including use of multi-line strings, modified comments and the rename of
user -> username according to previous changes, starting with [10288].

Additionally this broke all environment upgrades for plugins and for
Trac core itself, at least as long as the plugin was installed and enabled.

While this might be just a temporary Trac behavior (see Remy Blank's​comment in ticket #10451), it prevails in trunk
for more than a month now - a major headache for early adopters.
So I feel like acting now, facing the risk of not fixing it properly.

The logical next step is switching to the recommended procedure of storing
explicite db schema versions inside the Trac db like other plugins already do.