Active piston technique to optimize the chamber pressure in two-stage light-gas guns