Invariant sets for controlled degenerate diffusions: a viscosity solutions approach