Fixed NullPointerException with OpenJDK.

Please see https://github.com/gosu-lang/gosu/issues/88 for details.

I am not sure if this is the correct way to fix this issue.