Geidt said: ‘I feel that it is right that I am resigning from my post’ after questions over whether PM broke ministerial code