Maximum efficiency of ideal heat engines based on a small system: Correction to the Carnot efficiency at the nanoscale