Generation of self-sustained optical pulses from transients in external cavity semiconductor lasers