license: show expired notice to users
Created by: unknwon
Correctly displays license expired notice to users by fixing the order of middleware wrapping. It is a bit counter-intuitive that the actual call order is opposite to the order of wrapping.
Fixes #10363 (also see the issue for details why it was not working at all)