Top civil servant quits over alleged ‘vicious’ campaign by Home Secretary