Add a safety check.

release could be called twice, e.g., during normal cleanup and in
finalize.
Fix nStep calculation and use the USAGE_SHARED option.

- This fix crashes when calculating the Fourier transformation.
- Maybe avoid extra copying of data (not measured).