Cleaned up NestedProjectManager code.
Added NPE guards on all places where IResource.getLocation() is used,
since it can always return null for not existing projects and their
children (and in few other cases too of course).
Removed getInstance() block which would immediately fail with NPE if
synchronizing on a null field.
Made locationsToProjects synchronous map to avoid ConcurrentModification
exceptions and inconsistent states while accessing and updating the map
from different threads (the code is exposed to UI and resource callbacks
which usually operate on different threads).
Change-Id: I725c9f56c31ba99e5d0701fcf57a59ea87d41e21
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>