A passenger plane travelling from San Francisco to Australia was forced to make an emergency landing after one of its engines burst into flames.