datapath: keep mask array compact when deleting mask