LocalServer: better synchronization
(cherry picked from commit 7589f69)
Use JavaBuilder.addCompilationOptions to create Javac options
(cherry picked from commit c56a44b)