Fix a nasty bug when injecting target closures in BuildGraph

Just because a target has been injected doesn't mean that its
closure (and therefore its dependency edges) have been injected.
The current code misses the case where a target was injected
(but not its closure) and then has its closure injected later.

Testing Done:
Added a test that identifies the bug, which now passes (doesn't on master):
tests/python/pants_test/graph test_inject_then_inject_closure.

CI is green: https://travis-ci.org/pantsbuild/pants/builds/41270498

Reviewed at https://rbcommons.com/s/twitter/r/1337/
Fix java_sources missing dep detection.

This seems to just be an oversight in the original implementation.
We noticed incorrect missing dependency errors (we have it set to
error rather than warn) when we started using java_sources in our codegen.
This resolved our issue internally.

The general idea is that a ScalaLibrary should be claiming its
java_sources sources for the purpose of mapping generated classfiles
back to the sources zinc used to generate them.

Testing Done:
CI is green: https://travis-ci.org/pantsbuild/pants/builds/41043159

Reviewed at https://rbcommons.com/s/twitter/r/1336/
Kill all nailgun tasks after an integration test run to keep from leaking NGServer instances.

Before this change, Travis-CI builds are failing with: Cannot create GC thread. Out of system resources.
For example:  https://travis-ci.org/pantsbuild/pants/jobs/40841557

Testing Done:
CI running at: https://travis-ci.org/pantsbuild/pants/builds/41295684

Manual test: while running devpants goal test ./tests/python/pants_test:integration

before:
ps auxww | grep NGServer | wc -l
143

after:
ps auxww | grep NGServer | wc -l
13

Bugs closed: 799

Reviewed at https://rbcommons.com/s/twitter/r/1345/
Allow setting the cwd for goals run.jvm and test.junit