Convert NDData to numpy masked array if mask is set

Closes #2414