Iceland PM quits after Pirates advance in vote