Oxygen impurities link bistability and magnetoresistance in organic spin valves