Fix a bug in determining whether a task is async

This was causing async jobs to automatically succeed.

@vnivargi