Fix continual setting of task state to queued.

Fixes problem reported by @dpmatthews whereby queued tasks would repeatedly be set to queued resulting in them logging the setting and filling up the suite log.

@hjoliver - please review.