Drunk police officer who attacked 'terrified' woman resigns after being spared jail