check if processInstance is waiting at task before evaluating taskQuery(...)

fixes #36