ports: avoid adding port table entries and finalizers if possible
* libguile/ports.h (scm_t_port_type_flags, scm_t_ptob_descriptor): Add
flags to ptob descriptors.
* libguile/ports.c (scm_set_port_flush): Set the SCM_PORT_TYPE_HAS_FLUSH
flag here.
(scm_c_make_port_with_encoding): Only add ports to the table if
SCM_PORT_TYPE_HAS_FLUSH is set. Only add finalizers to ports if there
is a free function.
(scm_close_port): Inline scm_i_remove_port here. Only remove from the
weak set if SCM_PORT_TYPE_HAS_FLUSH is set.
(scm_set_port_revealed_x): Add a comment.