Attempting to fix server keeping port occupied after application exited