Fix passing of DynArrays to Java constructors (DYNJS-118)

This also fixes issues with passing DynArrays to Java methods
expecting primitive arrays (ie int[], boolean[], etc).