Fix java_compile postprocessing.

It's now correct in the presence of cached artifacts.

Auditors: markcc