src/channel-type.c (ptob_close): New procedure.

* src/channel-type.c (ptob_close): New procedure.
  (print_channel): Don't try to get state of a channel if its port
  is closed because it leads to segfaults.  Closed port means closed
  channel.
  (init_channel_type): Register `ptob_close' with
  `scm_set_port_close'.
* examples/echo/client.scm (main): Call `close' on a channel.
* examples/echo/server.scm (main): Likewise.