flush stream on system reset

Resubmitting this under a new branch. Need to test that all libraries extending Stream implement the flush method.