common: Clean up fd and code flow
common: Clean up fd and code flow

Suggested by coverity

larskarlitski/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,SotolitoLabs/cockpit,SotolitoLabs/cockpit,dperpeet/cockpit,xhad/cockpit,michalskrivanek/cockpit,andreasn/cockpit,andreasn/cockpit,dperpeet/cockpit,mareklibra/cockpit,mareklibra/cockpit,larsu/cockpit,garrett/cockpit,cockpit-project/cockpit,moraleslazaro/cockpit,larskarlitski/cockpit,stefwalter/cockpit,michalskrivanek/cockpit,SotolitoLabs/cockpit,larsu/cockpit,Scribery/cockpit,Scribery/cockpit,larskarlitski/cockpit,cockpituous/cockpit,xhad/cockpit,harishanand95/cockpit,petervo/cockpit,larskarlitski/cockpit,xhad/cockpit,martinpitt/cockpit,Scribery/cockpit,deryni/cockpit,cockpituous/cockpit,Scribery/cockpit,larskarlitski/cockpit,Scribery/cockpit,stefwalter/cockpit,cockpituous/cockpit,larskarlitski/cockpit,andreasn/cockpit,deryni/cockpit,larsu/cockpit,cockpituous/cockpit,michalskrivanek/cockpit,harishanand95/cockpit,xhad/cockpit,mareklibra/cockpit,mareklibra/cockpit,deryni/cockpit,larskarlitski/cockpit,martinpitt/cockpit,dperpeet/cockpit,martinpitt/cockpit,stefwalter/cockpit,SotolitoLabs/cockpit,garrett/cockpit,mvollmer/cockpit,michalskrivanek/cockpit,xhad/cockpit,mvollmer/cockpit,Scribery/cockpit,harishanand95/cockpit,SotolitoLabs/cockpit,deryni/cockpit,mvollmer/cockpit,garrett/cockpit,Scribery/cockpit,larsu/cockpit,martinpitt/cockpit,petervo/cockpit,mareklibra/cockpit,xhad/cockpit,SotolitoLabs/cockpit,xhad/cockpit,michalskrivanek/cockpit,larsu/cockpit,cockpituous/cockpit,andreasn/cockpit,moraleslazaro/cockpit,andreasn/cockpit,mareklibra/cockpit,dperpeet/cockpit,stefwalter/cockpit,harishanand95/cockpit,mareklibra/cockpit,mvollmer/cockpit,mvollmer/cockpit,garrett/cockpit,harishanand95/cockpit,martinpitt/cockpit,stefwalter/cockpit,garrett/cockpit,cockpituous/cockpit,harishanand95/cockpit,cockpit-project/cockpit,andreasn/cockpit,petervo/cockpit,michalskrivanek/cockpit,deryni/cockpit,cockpit-project/cockpit,petervo/cockpit,stefwalter/cockpit,deryni/cockpit,moraleslazaro/cockpit,larsu/cockpit,moraleslazaro/cockpit,moraleslazaro/cockpit,harishanand95/cockpit,stefwalter/cockpit,petervo/cockpit,dperpeet/cockpit,andreasn/cockpit,michalskrivanek/cockpit,deryni/cockpit,petervo/cockpit,cockpit-project/cockpit,dperpeet/cockpit,SotolitoLabs/cockpit,petervo/cockpit,moraleslazaro/cockpit,dperpeet/cockpit