Consistent nonlinear KK reduction of 11d supergravity on AdS7×S4 and self-duality in odd dimensions