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
Merge pull request #1544 from dawgfoto/fixLinkHang

refactor findNoMainError