An American Airlines flight from Madrid diverted to New York Tuesday afternoon after all but two of the lavatories on the Boeing 777 stopped working.