Fix port staying bound after program finishes running