Toughen code to handle the case that no rows are masked

See https://jira.lsstcorp.org/browse/DM-415.  In this case all the rows
were bad, but the masking code passed them all so this bug triggered