Ok last night I had a quick play with my setup before the battery died.

I tried these two lines of code; the first line sets the camera to burst mode the second tells the camera to use 5 bursts. this successfully utilized the camera's frame buffer.

gphoto2 --set-config /main/capturesettings/capturemode=1
gphoto2 --set-config /main/capturesettings/burstnumber=5

However when trying these settings with your script I ended up with 5 frames of each exposure intotal 25 frames.