Supersymmetric self-dual Yang-Mills and supergravity as background of the Green-Schwarz superstring