Update have_work flag when ScheduleWork is aborted

If ScheduleWork() is not going to post a message to the pump window,
it needs to update the have_work flag again so that the state is
consistent.