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.
Avoid workspace-wide locks when building.

There is no reason to lock the workspace when building a project. Markers already
lock the required resources, and the build should just lock the current project.

Fixed #1001631.
Fixed PC race condition in semantic highlighting

I see no reason for treating Tuple/Function in ``AppliedTypeTree`` nodes any
different that any other type application. Furthermore, if you look at the two
``case AppliedTypeTree``, it looks like we don't really need the information.
All we need is **not traversing** the ``Select`` of the ``AppliedTypeTree`` if
it doesn't appear in the source code (i.e., it doesn't have a range position),
which is what I do with this commit.

Fixes #1001623
Merge pull request #391 from huitseeker/backports-juno

[backport] Backports #358, #360, #353