Make JUnit/Hamcrest detection more flexible

...so it accepts a hand-crafted junit.jar that references the hamcrest jar on
its manifest class-path.

Change-Id: I9a6c7c1be8cd4a70c263de0f799973baf8d2b951