The outgoing boss of BP believes he was "demonised and vilified" over the firm's Gulf of Mexico oil spill crisis.