checking whether stream is already closed to avoid warning
checking whether stream is already closed to avoid warning

wjzijderveld/jackalope-doctrine-dbal,rederrik/jackalope-doctrine-dbal,yelmontaser/jackalope