Closes the stream indicated by `stream'. No data can be read or written
to the stream after calling this function. Return TRUE if the stream
could be closed. If action is taken on closed stream the notifier
callback may be called with an error status.