When reverse-stepping a thread that has a pending breakpoint event, the
thread is not resumed as part of the infcmd function. A first resume
notices the event and returns without resuming the target.
If the corresponding breakpoint has been deleted, event processing results
in a second resume that performs the intended stepping action. That
resume happens after the infcmd function returned and the temporarily
modified execution direction was restored. We end up resuming in the
wrong direction.
Store the direction in a thread's control state and change most of
infrun to take it from there rather than using the global variable.