Travis CI: only run cobertura when build succeeded

Also prepare the artifactory deployment to be performed in after_success stage.