minor #16798 [Process] Unset callback after stop to free memory (Slamdunk)
minor #16798 [Process] Unset callback after stop to free memory (Slamdunk)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #16798).

Discussion
----------

[Process] Unset callback after stop to free memory

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

As of yet, a `Process` instance can't free memory.
The built-in callback has a self-reference to the intance not cleared after instance destruction.
I've tried to change both `buildCallback` and https://github.com/symfony/process/blob/v2.7.6/Process.php#L1373 usage to avoid self-referencing, but it can't be done without breaking BC, and the memory issue is still there.

A simple test script (that obiously can't be embedded in unit-tests)
```php
for ($inc = 0; $inc < 10000; $inc++) {
    $process = new Symfony\Component\Process\Process('echo 1');
    $process->mustRun();
    $process->stop();
    unset($process);

    echo (memory_get_usage(true) / 1000000) . ' MB ' . $inc . PHP_EOL;
}
```
Before:
```
1.572864 MB 0
5.505024 MB 9999
```
After:
```
1.572864 MB 0
1.572864 MB 9999
```
Ok, in this simple scenario 4 MB of RAM is nothing, but in our business app full of IOC where `unset`-ting is hard, our RAM explodes.

After `stop()`, the callback is no longer necessary.

To be clear, the garbage collector in the previous example was already active.
Deactivating it manually, which somewhere is needed to avoid particluar segfaults, obiously leads to worse scenarios:

Before:
```
 gc_disable();
 1.572864 MB 0
29.360128 MB 9999
```
After:
```
 gc_disable();
 1.572864 MB 0
 1.572864 MB 9999
```

Commits
-------

ec93b9a [Process] Unset callback after stop to free memory

mihai-stancu/symfony,romainneutron/symfony,andreia/symfony,alekitto/symfony,realityking/symfony,jderusse/symfony,ro0NL/symfony,jakubsacha/symfony,dunglas/symfony,Einenlum/symfony,shieldo/symfony,hacfi/symfony,adamelso/symfony,c960657/symfony,tPl0ch/symfony,maidmaid/symfony,dkarvounaris/symfony,unexge/symfony,thunderer/symfony,Aliance/symfony,ragboyjr/symfony,mpdude/symfony,gonzalovilaseca/symfony,Simperfit/symfony,smatyas/symfony,geoffrey-brier/symfony,MisatoTremor/symfony,SofHad/symfony,teohhanhui/symfony,digitalkaoz/symfony,jjanvier/symfony,Padam87/symfony,nasimnabavi/symfony,phramz/symfony,yceruto/symfony,webmozart/symfony,ewgRa/symfony,Wasserschlange/symfony,zerkms/symfony,HeahDude/symfony,thunderer/symfony,dzuelke/symfony,MatTheCat/symfony,bendavies/symfony,inso/symfony,ro0NL/symfony,voronkovich/symfony,jameshalsall/symfony,Einenlum/symfony,Koc/symfony,curry684/symfony,jpauli/symfony,dbu/symfony,vincentaubert/symfony,romaricdrigon/symfony,pamil/symfony,Tobion/symfony,bendavies/symfony,OndraM/symfony,dmaicher/symfony,vincentaubert/symfony,patrick-mcdougle/symfony,bburnichon/symfony,smatyas/symfony,tronsha/symfony,realityking/symfony,MisatoTremor/symfony,jderusse/symfony,georaldc/symfony,fabpot/symfony,georaldc/symfony,digitalkaoz/symfony,mweimerskirch/symfony,tucksaun/symfony,dkarvounaris/symfony,apfelbox/symfony,apfelbox/symfony,Ocramius/symfony,deguif/symfony,calm10/Symfony2,Slamdunk/symfony,derrabus/symfony,SpacePossum/symfony,SaschaDens/symfony,hiddewie/symfony,k0pernikus/symfony,OndraM/symfony,Deamon/symfony,believer-ufa/symfony,Ocramius/symfony,localheinz/symfony,superdav42/symfony,mnapoli/symfony,dzuelke/symfony,xabbuh/symfony,mpdude/symfony,Ener-Getick/symfony,mihai-stancu/symfony,GuilhemN/symfony,zerustech/symfony,symfony/symfony,pyrech/symfony,frankdejonge/symfony,MisatoTremor/symfony,sroze/symfony,gimler/symfony,jakubsacha/symfony,dbu/symfony,romainneutron/symfony,neemzy/symfony,garak/symfony,Engerim/symfony,chalasr/symfony,MatTheCat/symfony,zerkms/symfony,Deamon/symfony,backbone87/symfony,mihai-stancu/symfony,zcodes/symfony,oleg-andreyev/symfony,SaschaDens/symfony,lstrojny/symfony,havvg/symfony,OndraM/symfony,patrick-mcdougle/symfony,danionut90/symfony,hiddewie/symfony,smatyas/symfony,chrisguitarguy/symfony,thunderer/symfony,jameshalsall/symfony,sroze/symfony,mpdude/symfony,mickaelandrieu/symfony,webmozart/symfony,tronsha/symfony,SofHad/symfony,k0pernikus/symfony,alekitto/symfony,believer-ufa/symfony,gimler/symfony,vincentaubert/symfony,andrerom/symfony,GuilhemN/symfony,jvasseur/symfony,Ocramius/symfony,lemoinem/symfony,Ocramius/symfony,ro0NL/symfony,unexge/symfony,Pierstoval/symfony,ogizanagi/symfony,lemoinem/symfony,bendavies/symfony,geoffrey-brier/symfony,bburnichon/symfony,realityking/symfony,hiddewie/symfony,pierredup/symfony,sgehrig/symfony,Tobion/symfony,realityking/symfony,apetitpa/symfony,mvhirsch/symfony,mvhirsch/symfony,Amo/symfony,voronkovich/symfony,DavidGarciaCat/symfony,OskarStark/symfony,garak/symfony,gnat42/symfony,Slamdunk/symfony,codeclimate-testing/symfony,mweimerskirch/symfony,dunglas/symfony,tPl0ch/symfony,dkarvounaris/symfony,klandaika/symfony,zorn-v/symfony,sroze/symfony,Amo/symfony,dunglas/symfony,smatyas/symfony,ewgRa/symfony,Simperfit/symfony,c960657/symfony,zerkms/symfony,gimler/symfony,Padam87/symfony,zerustech/symfony,WhiteEagle88/symfony,WouterJ/symfony,SpacePossum/symfony,mickaelandrieu/symfony,hhamon/symfony,lemoinem/symfony,xabbuh/symfony,EVODelavega/symfony,tgalopin/symfony,zorn-v/symfony,yceruto/symfony,c960657/symfony,backbone87/symfony,gencer/symfony,dbu/symfony,jakubsacha/symfony,lstrojny/symfony,codeclimate-testing/symfony,lemoinem/symfony,Triiistan/symfony,apetitpa/symfony,hiddewie/symfony,andrerom/symfony,andrerom/symfony,pix-art/symfony,frankdejonge/symfony,jameshalsall/symfony,ajgarlag/symfony,aeoris/symfony,Aliance/symfony,arjenm/symfony,Nyholm/symfony,kbond/symfony,chrisguitarguy/symfony,deguif/symfony,gencer/symfony,csarrazi/symfony,iltar/symfony,mnapoli/symfony,digitalkaoz/symfony,jpauli/symfony,oleg-andreyev/symfony,oleg-andreyev/symfony,OndraM/symfony,kbond/symfony,josephdpurcell/symfony,digitalkaoz/symfony,SofHad/symfony,jakubsacha/symfony,frankdejonge/symfony,georaldc/symfony,mihai-stancu/symfony,smatyas/symfony,hhamon/symfony,Taluu/symfony,nicolas-grekas/symfony,tronsha/symfony,mickaelandrieu/symfony,Taluu/symfony,Soullivaneuh/symfony,GuilhemN/symfony,sroze/symfony,MisatoTremor/symfony,danionut90/symfony,e-moe/symfony,mihai-stancu/symfony,alekitto/symfony,adamelso/symfony,EVODelavega/symfony,dmaicher/symfony,webmozart/symfony,AlexDpy/symfony,jpauli/symfony,Soullivaneuh/symfony,hhamon/symfony,geoffrey-brier/symfony,damienalexandre/symfony,dosten/symfony,joelwurtz/symfony,MatTheCat/symfony,alebo/symfony,Soullivaneuh/symfony,Strate/symfony,zerustech/symfony,natechicago/symfony,tucksaun/symfony,nasimnabavi/symfony,patrick-mcdougle/symfony,ewgRa/symfony,mpdude/symfony,hhamon/symfony,curry684/symfony,Wasserschlange/symfony,tPl0ch/symfony,klandaika/symfony,weaverryan/symfony,gnat42/symfony,mickaelandrieu/symfony,georaldc/symfony,maidmaid/symfony,GuilhemN/symfony,mweimerskirch/symfony,chrisguitarguy/symfony,tgalopin/symfony,garak/symfony,georaldc/symfony,HeahDude/symfony,ragboyjr/symfony,Taluu/symfony,geoffrey-brier/symfony,iltar/symfony,sstok/symfony,1ed/symfony,Wasserschlange/symfony,SpacePossum/symfony,jakubsacha/symfony,mvhirsch/symfony,Koc/symfony,Nyholm/symfony,sgehrig/symfony,adamelso/symfony,yceruto/symfony,ogizanagi/symfony,realityking/symfony,joelwurtz/symfony,ajgarlag/symfony,weaverryan/symfony,AlexDpy/symfony,jean-gui/symfony,pierredup/symfony,natechicago/symfony,calm10/Symfony2,jakzal/symfony,WouterJ/symfony,ewgRa/symfony,csarrazi/symfony,xabbuh/symfony,MisatoTremor/symfony,jzawadzki/symfony,aeoris/symfony,believer-ufa/symfony,Engerim/symfony,e-moe/symfony,gonzalovilaseca/symfony,GuilhemN/symfony,pix-art/symfony,inso/symfony,lstrojny/symfony,Amo/symfony,pierredup/symfony,ajgarlag/symfony,weaverryan/symfony,Engerim/symfony,Strate/symfony,michaelperrin/symfony,believer-ufa/symfony,jameshalsall/symfony,k0pernikus/symfony,romaricdrigon/symfony,lyrixx/symfony,Koc/symfony,romainneutron/symfony,unexge/symfony,tgalopin/symfony,natechicago/symfony,mweimerskirch/symfony,pyrech/symfony,Ener-Getick/symfony,jakzal/symfony,docteurklein/symfony,1ed/symfony,alekitto/symfony,apetitpa/symfony,sstok/symfony,hacfi/symfony,SaschaDens/symfony,SpacePossum/symfony,maidmaid/symfony,derrabus/symfony,oleg-andreyev/symfony,maidmaid/symfony,chalasr/symfony,Strate/symfony,andreia/symfony,joelwurtz/symfony,dosten/symfony,jakzal/symfony,Simperfit/symfony,Nyholm/symfony,hason/symfony,derrabus/symfony,dbu/symfony,EVODelavega/symfony,nicolas-grekas/symfony,kbond/symfony,OskarStark/symfony,iltar/symfony,frankdejonge/symfony,dkarvounaris/symfony,romainneutron/symfony,pix-art/symfony,dkarvounaris/symfony,pierredup/symfony,okdana/symfony,alebo/symfony,tPl0ch/symfony,dbu/symfony,realityking/symfony,tgalopin/symfony,d-ph/symfony,hason/symfony,thunderer/symfony,pyrech/symfony,1ed/symfony,tronsha/symfony,nasimnabavi/symfony,jvasseur/symfony,paradajozsef/symfony,pamil/symfony,DavidGarciaCat/symfony,tronsha/symfony,Taluu/symfony,natechicago/symfony,alebo/symfony,dmaicher/symfony,jjanvier/symfony,c960657/symfony,andreia/symfony,Triiistan/symfony,thunderer/symfony,nicolas-grekas/symfony,zerustech/symfony,SaschaDens/symfony,AlexDpy/symfony,sstok/symfony,ogizanagi/symfony,josephdpurcell/symfony,Slamdunk/symfony,Wasserschlange/symfony,natechicago/symfony,EVODelavega/symfony,deguif/symfony,dzuelke/symfony,MatTheCat/symfony,danionut90/symfony,apfelbox/symfony,SofHad/symfony,unexge/symfony,bburnichon/symfony,jzawadzki/symfony,okdana/symfony,Simperfit/symfony,havvg/symfony,chalasr/symfony,joelwurtz/symfony,neemzy/symfony,zerustech/symfony,gnat42/symfony,jpauli/symfony,voronkovich/symfony,phramz/symfony,codeclimate-testing/symfony,alebo/symfony,gimler/symfony,josephdpurcell/symfony,Simperfit/symfony,apetitpa/symfony,Wasserschlange/symfony,damienalexandre/symfony,Einenlum/symfony,ewgRa/symfony,jjanvier/symfony,Amo/symfony,EVODelavega/symfony,curry684/symfony,xabbuh/symfony,superdav42/symfony,symfony/symfony,apfelbox/symfony,jvasseur/symfony,pix-art/symfony,e-moe/symfony,jakzal/symfony,docteurklein/symfony,mweimerskirch/symfony,zcodes/symfony,Tobion/symfony,havvg/symfony,patrick-mcdougle/symfony,Triiistan/symfony,mvhirsch/symfony,Ener-Getick/symfony,voronkovich/symfony,jameshalsall/symfony,ajgarlag/symfony,e-moe/symfony,tronsha/symfony,yceruto/symfony,inso/symfony,Soullivaneuh/symfony,localheinz/symfony,Ocramius/symfony,jpauli/symfony,MisatoTremor/symfony,havvg/symfony,chrisguitarguy/symfony,AlexDpy/symfony,Padam87/symfony,curry684/symfony,stof/symfony,believer-ufa/symfony,romaricdrigon/symfony,georaldc/symfony,gnat42/symfony,pyrech/symfony,ro0NL/symfony,Ener-Getick/symfony,fabpot/symfony,jjanvier/symfony,unexge/symfony,zorn-v/symfony,gonzalovilaseca/symfony,calm10/Symfony2,bburnichon/symfony,ogizanagi/symfony,klandaika/symfony,sgehrig/symfony,natechicago/symfony,teohhanhui/symfony,WouterJ/symfony,Triiistan/symfony,ragboyjr/symfony,shieldo/symfony,OskarStark/symfony,nasimnabavi/symfony,sstok/symfony,arjenm/symfony,backbone87/symfony,superdav42/symfony,Deamon/symfony,mnapoli/symfony,jvasseur/symfony,HeahDude/symfony,klandaika/symfony,gencer/symfony,Ener-Getick/symfony,michaelperrin/symfony,digitalkaoz/symfony,mnapoli/symfony,phramz/symfony,lepiaf/symfony,pamil/symfony,jpauli/symfony,jean-gui/symfony,derrabus/symfony,calm10/Symfony2,Deamon/symfony,Triiistan/symfony,jean-gui/symfony,arjenm/symfony,SpacePossum/symfony,zerkms/symfony,lyrixx/symfony,danionut90/symfony,jderusse/symfony,k0pernikus/symfony,stof/symfony,deguif/symfony,OskarStark/symfony,kbond/symfony,symfony/symfony,sgehrig/symfony,mickaelandrieu/symfony,Ener-Getick/symfony,pix-art/symfony,ragboyjr/symfony,lemoinem/symfony,jean-gui/symfony,danionut90/symfony,gonzalovilaseca/symfony,Pierstoval/symfony,Amo/symfony,tPl0ch/symfony,chrisguitarguy/symfony,pamil/symfony,michaelperrin/symfony,k0pernikus/symfony,vincentaubert/symfony,chalasr/symfony,Nyholm/symfony,docteurklein/symfony,Soullivaneuh/symfony,apfelbox/symfony,fabpot/symfony,Slamdunk/symfony,jjanvier/symfony,romaricdrigon/symfony,DavidGarciaCat/symfony,sstok/symfony,hiddewie/symfony,dosten/symfony,superdav42/symfony,geoffrey-brier/symfony,weaverryan/symfony,patrick-mcdougle/symfony,dzuelke/symfony,paradajozsef/symfony,teohhanhui/symfony,okdana/symfony,1ed/symfony,mvhirsch/symfony,iltar/symfony,Koc/symfony,dosten/symfony,romainneutron/symfony,damienalexandre/symfony,michaelperrin/symfony,paradajozsef/symfony,tucksaun/symfony,arjenm/symfony,localheinz/symfony,bburnichon/symfony,symfony/symfony,hacfi/symfony,lyrixx/symfony,SaschaDens/symfony,jzawadzki/symfony,adamelso/symfony,inso/symfony,phramz/symfony,localheinz/symfony,superdav42/symfony,Aliance/symfony,codeclimate-testing/symfony,stof/symfony,HeahDude/symfony,SofHad/symfony,Tobion/symfony,dmaicher/symfony,docteurklein/symfony,superdav42/symfony,stof/symfony,dosten/symfony,paradajozsef/symfony,d-ph/symfony,AlexDpy/symfony,WhiteEagle88/symfony,adamelso/symfony,alebo/symfony,aeoris/symfony,Padam87/symfony,damienalexandre/symfony,Pierstoval/symfony,docteurklein/symfony,lyrixx/symfony,believer-ufa/symfony,zorn-v/symfony,havvg/symfony,webmozart/symfony,inso/symfony,Einenlum/symfony,OndraM/symfony,klandaika/symfony,d-ph/symfony,nicolas-grekas/symfony,ewgRa/symfony,d-ph/symfony,danionut90/symfony,pix-art/symfony,webmozart/symfony,andrerom/symfony,lepiaf/symfony,shieldo/symfony,geoffrey-brier/symfony,WhiteEagle88/symfony,andreia/symfony,jderusse/symfony,tucksaun/symfony,shieldo/symfony,bendavies/symfony,Pierstoval/symfony,calm10/Symfony2,neemzy/symfony,Padam87/symfony,zcodes/symfony,teohhanhui/symfony,fabpot/symfony,mnapoli/symfony,lepiaf/symfony,zcodes/symfony,hason/symfony,dzuelke/symfony,csarrazi/symfony,Deamon/symfony,Ocramius/symfony,garak/symfony