Don't add arguments templates for parameterless method's completion

When asking for completion on a parameterless method we were trying to install
arguments' templates. This operation in not allowed on parameterless methods,
and it caused a ``java.lang.IllegalStateException: must specify at least one
linked position`` during completion.

``explicitParamNames`` is a ``List[List[String]]`` (because of currying), hence
a parameterless method is represented as ``List(List())``. The arguments'
templates where added only if ``explicitParamNames`` is not empty, however a
``List(List())`` contains exactly one element (the empty list), hence it's
never empty!  The fix is really simple, we just need to flatten the
``explicitParamNames`` before checking for emptiness.

Fixes #1001591

backport to _release/3.0.x_

review by @dragos
Merge pull request #349 from dotta/issue/ISE-during-code-completion-1001591

Don't add arguments templates for parameterless method's completion
Workaround for NPE in debugger variable view when using Eclipse Juno

Unfortunately, the way we keep track of the currently selected thread in the
Scala debugger isn't robust enough. Currently, we rely on a _selectionChanged_
event to be sent when the Debug Perspective is opened. This worked fine with
Eclipse Indigo, but it's no longer working with Eclipse Juno.

The workaround is to look for the first suspended thread if
``ScalaDebugger.currentThread`` is null. This is far from being a proper fix,
but it doesn't look like we have many alternatives. The Java debugger
implementation seem to be using a DebugContextProvider/Manager/Event/Listener
to know the thread associated to each variable. But using the debug context
classes would require some import work, so it would be preferable to delay this
for after the 3.0.0 final release.

The workaround was suggested by @skyluc, and he believes the only issue this
could lead to is visibility issues due to invoking a method call on the wrong
thread (in case more than one is suspended), and hence the executing thread may
see some stale values. Not an issue to be taken lightly.

Fix #1001585

backport to _release/3.0.x_
Merge pull request #351 from dotta/issue/NPE-on-variable-view-with-Eclipse-Juno-1001585

Workaround for NPE in debugger variable view when using Eclipse Juno
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.
Merge pull request #353 from dragos/issue/fix-none-get-101599

Correctly search for threads, and don't use `Option.get`
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.
Merge pull request #360 from dragos/issue/fine-grained-locks-build-1001631

Avoid workspace-wide locks when building.