refactor findNoMainError

- use fread/fwrite with 64K buffer

- wrap buffer at newline so to not
  split and miss the error message

- avoid hang when linker output exceeds
  pipe buffer
fix Issue 9385 - [Regression 2.057] null literal should be implicitly convertible to bool
Merge pull request #1544 from dawgfoto/fixLinkHang

refactor findNoMainError
Merge pull request #1545 from 9rnsr/fix9385

Issue 9385 - [Regression 2.057] null literal should be implicitly convertible to bool