Bug 2040: Reschedule flow thread in case of error.

Change-Id: I83a42d67e37a2d792dbaa85743d91c103093aa0e
Signed-off-by: Alex Fan <railor33@gmail.com>