Fix crash when connection ends on non-free pin