Fix closing stream of locked sep when reconfiguring

Stream should only be closed if sep is unlocked otherwise there is a
possibility that sep reconfiguration is triggered although the sep is in
use by the user application.
1 file changed