Fix input/output arrays with new numpy.i swig typemaps

- Apply extra numpy typemaps where the size is not const.

- With the new numpy API we can no longer modify the data pointer for an
  array but this is ok, by setting the size to zero numpy will not try
  to access data that it shouldn't.