Fix postgres process not exiting cleanly