Fix a scope bug for java agent manifest writing.

Also fix a JavaAgent validation bug revelead by adding a test for
JarBuilder agent handling.

Testing Done:
$ PANTS_DEV=1 ./pants goal test tests/python/pants_test/tasks/:jar_task --test-pytest-options=-v
...
18:05:24 00:01   [test]
18:05:24 00:01     [pytest]
18:05:24 00:01       [run]
                     ============== test session starts ===============
                     platform linux2 -- Python 2.6.9 -- py-1.4.22 -- pytest-2.5.2 -- /usr/bin/python2.6
                     plugins: cov, timeout
                     collected 6 items

                     tests/python/pants_test/tasks/test_jar_task.py:111: JarTaskTest.test_custom_manifest PASSED
                     tests/python/pants_test/tasks/test_jar_task.py:86: JarTaskTest.test_overwrite_write PASSED
                     tests/python/pants_test/tasks/test_jar_task.py:102: JarTaskTest.test_overwrite_writestr PASSED
                     tests/python/pants_test/tasks/test_jar_task.py:57: JarTaskTest.test_update_write PASSED
                     tests/python/pants_test/tasks/test_jar_task.py:73: JarTaskTest.test_update_writestr PASSED
                     tests/python/pants_test/tasks/test_jar_task.py:133: JarBuilderTest.test_agent_manifest PASSED

                     ============ 6 passed in 1.27 seconds ============

18:05:26 00:03     [junit]
18:05:26 00:03     [specs]
               SUCCESS

Bugs closed: 401

Reviewed at https://rbcommons.com/s/twitter/r/768/