Fix masking in arithmetic

Before merging, needs:

- [ ] CHANGES.rst entry for appropriate release
- [ ] rebase if #2395 is merged first

This PR changes the actual behavior of ``NDData._arithmetic`` to match that in its documentation and of numpy masked arrays.