Check to see if returned task has associated deployment

Fixes rhbz#1125327

cc @pitr-ch