Fix #846

Fix #846: array.flat() was incorrect with non-contiguous empty arrays with a non-zero dimension size.