Unexpected origin of magnetism in monoclinic Nb12O29 from first-principles calculations