Only do gradle check for pull requests

Prior to this commit pull request builds would fail in Travis CI due to missing credentials (for security reasons). This commit limits the builds for the pull requests to the 'check' task to make sure that it builds and that all tests passes.
Merge pull request #375 from bjornerik/travis-pr

Only do gradle check for pull requests