travis: Install dependencies for each test dynamically

Since the installation of all packages alone takes several minutes this
should speed up some test cases.
configure: Add an option to select a specific printf hook implementation
travis: Add tests for printf hook implementations
test