Merge the r1499470 group from trunk:

 * r1499470, r1543413
   Flush stdout before exiting svn with an error.
   Justification:
      Without this patch merge_tests.py 135 may fail to output its required
      output.
   Votes:
     +1: ivan (without r1543413)
     +1: rhuijben, stsp, pburba


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.8.x@1544028 13f79535-47bb-0310-9956-ffa450edef68