Correctly search for threads, and don't use `Option.get`

JDI objects implement `equals`, we should not rely on reference equality.

This is the last instance of `Option.get` in the debugger.

Fixed #1001599.(cherry picked from commit 359aec26f5a2e36b86ab86aae9267ad9c01584f5)