[Backport] Fix flash_messages.error(request, msg) call, object receives only msg.

(cherry picked from commit f8986c8b669037096f41bc2e5504a5e712b84364)