allow resizing arrays that share data as long as they don't own it

fixes #4592