fix Stream::getUri() crash on closed streams