Add callback for checking run status

Waiting for run status to have a specific value, such as Running,
means that alternative outcomes, like Failed, only get detected
after a timeout. Also, the displayed error is TimeoutException,
which is not very informative.

This patch provides a method to call a function whenever the status
changes. This allows better handling of alternative outcomes, and
more descriptive error messages.