travis: merge Linux and OS X install scripts

This way we can provide scalability for more OS variations and
avoid code duplication.