Fix peripheral deallocation when connecting