fix ArrayJavaProxy#to_a failure on arrays containing null

https://github.com/jruby/jruby/commit/b96b2219f9df6622883a88eda0ae1dbbcb5c2267 added an unprotected method call in a place where the
target could be null. This adds a null check to that expression.
Merge pull request #1818 from baroquebobcat/null_java_array_regression

fix ArrayJavaProxy#to_a failure on arrays containing null