Previously this code used system(), which waits for the child process to exit. Dpkg::IPC::spawn doesn't do that unless you pass a true value for the wait_child option.
Regression in 25d09aff (#810294).