Fix the watchpoint/breakpoint code to search for matching thread entry
in m_threads explicitly rather than assuming that it will be present
at specified index. The previous code segfault since it wrongly assumed
that the index will match LWP ID which was incorrect even for a single
thread (where index was 0 and LWP ID was 1).
While fixing that off-by-one error would help for this specific task,
I believe it is better to be explicit in what we are searching for.
We should always have a fallback and whenever we register an event for an unknown thread, we shall create it in place. There are potential races in the kernel that might lead to this order of reporting events. This is less likely for DB Registers, but still we shall be prepared for it just in case.
I'm fine to leave this for later once we will handle debuggees with multiple threads.