find_window_by_regex: use exit code to indicate match

Also return/break after first action as per documentation.