fix FileInputStream for newer openjdk7 versions

This fixes #76.

I've tested this on both a newer openjdk-src build (when cherry-picked on top of the code for #129), and a normal openjdk (7u45) build - so both branches are good.