Fix appending of scalar arrays.

The following code would fail despite logic to handle scalar values
since len(narray.shape) == 0. This patch fixes that issue.

> do = dsa.WrapDataObject()
> val = algorithms.max(do.PointData["Temp"])
> do.append(val, "Result")

val, in this case is not a scalar but a VTKArray (or similar) causing
the "fixup input array length" code to fail.

Change-Id: I2193e08d0514dcfec5903a2f49a40eb58cfe8eb9
Fix DataSet reference in when input array is passed to output.

An array would take with itself a reference to the dataset when the
array. This fix breaks the link between the array and dataset when the
array is added to a new DataSetAttributes object.

Change-Id: I3237f4194e5681a3d3dd0fe1d0583eed3d7b8e4b
Avoid exceptions on StringArrays.

dataset_adapter would raise exceptions when encoutering string arrays
(or other non-dataarray arrays). Fixed that.

Change-Id: I9b696acd6bc987fd834f10a2674ad8888e62ae9a
Fixed exceptions with older numpy version.

NumPy 1.5.1 (and may be others) incorrectly raised a ValueError
exception when numpy.frombuffer() was called with a empty buffer. This
patch handles that exception by creating an empty array using
numpy.empty() instead.

Reference:
http://mail.scipy.org/pipermail/numpy-tickets/2011-August/005859.html

Change-Id: Id138928c3fd5f407b8eb266d3274ddd1a3459de1
Cleanup MPI controller properly.

If the python script run by pvtkpython called sys.exit() explicitly, the
MPI controller cleanup logic wouldn't kick in and the controller would
leak causing test failures. Adding a Py_AtExit() handler ensures that
the controller is cleaned up when the Python interpreter is finalized,
one way or the other.

Change-Id: I5433fcc111b20b3f7f9809d4d8f61c1128b216e2
Merge topic 'python_calculator_fixes' into master

5c735a68 Cleanup MPI controller properly.
b345cec1 Fixed exceptions with older numpy version.
abf3539c Avoid exceptions on StringArrays.
4e338f34 Fix DataSet reference in when input array is passed to output.
59360cd5 Fix appending of scalar arrays.