File related fixes

* Fix filenames for IPv6.  Colons replaced by underscores.
* Fix log saving when ip has a port.
* Fix chat logging twice sometimes.