remove_from_known_peers function in peermanager. fix tests to use tmpdir