The piston-flow interaction as a model for the deflagration-to-detonation transition