Scotland's first minister quits rather than face no confidence vote