Quantum optomechanical piston engines powered by heat