Potentially close stream when a data frame is received.