Malaysian PM resigns in shock move