nodemask: make NODEMASK_ALLOC more general