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.