helper_thread: Introduce the wait_for_action() function