Magdalena Andersson hands in resignation hours after being appointed by parliament after budget fails to pass and the Green Party quits her coalition