BP swung back to a small profit in the third quarter but warned the pace of recovery from the pandemic remains uncertain and continued to weigh on fuel demand and refining profits.