Added from latest hockeypuck,cleanly close the peer so that tree will be in consistent state.