Fix missing flash on file edit error from web UI.

These bugs were introduced by myself at https://github.com/gitlabhq/gitlabhq/pull/7807

The fact that the refactoring lead to bugs means we should add more tests for those error cases =)

Also removed the `out[:error] = ''` which never happens: every place of the app first checks for `success`.

Added tests that would have prevented me from generating this bug. One of them is `@wip` as explained on the source: I can't get it working no matter what. Still it shows the behavior and does an initial step to point to the cause of the problem.
here