Travis: auto rebase on master before running

It can happen that two PRs don't interfere with each other in the sense
that they hurt automatic rebasing, but still do not work together. The
prime example is PR1 changes the API of some function that PR2 uses. If
PR1 is merged, and PR2 is not rebased before merging, the error might
get unnoticed before the next build. Travis CI would have have told both
PR1 and PR2 are fine, but will complain (rather unnoticedly) that our
master does not compile.

This PR automatically rebases the PR on top of the current master,
before running the tests. If the automatic rebase fails, then this is
fine, because you will need to manually rebase again before merging,
anyway. The manual rebase, i.e. new push, will trigger Travis CI.

So, the main idea of this PR is that to can hit the "Restart Build"
button in Travis CI before hitting the merge button in Github.
Merge pull request #1526 from Kijewski/rebase-on-master

Travis: auto rebase on master before running