[BUGFIX] Limit number of flash messages

Change-Id: I6f419ae08874159fb628ab2386c83681cb7966fd
Fixes: #53628
Reviewed-on: https://review.typo3.org/25394
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers