Ensure that a non-zero exit code is set both for missing random dylibs
and random missing dependencies.
Additionally, while we are here, drastically trim down the public
interface for this class to the bare minimum and allow getting the
output from `display_test_output` as a variable.
Fixes issue mentioned by @ilovezfs in:
https://github.com/Homebrew/brew/pull/3940#issuecomment-383794520
1. In "display_test_output": when printing dependencies without
linkage, use "Dependencies with no linkage" string instead of "Possible
unnecessary dependencies" for consistency with "display_normal_output"
2. In "check_dylibs": keep track of and skip repetitive checking of
those dylibs that have been previously checked. This is applicable when
different executables/libraries are linked against the same libraries.
3. In "check_undeclared_deps": when there are missing libraries,
corresponding dependencies should be excluded from the list of
dependencies with no linkage.