Common features in the thermoacoustics of flames and engines