pkg/proc: moving defer after error check
Merge pull request #311 from gprggr/proc

pkg/proc: moving defer after error check