explicitly close opened streams

Change-Id: I7584e822146e4ba9b88dbae77c635408f92c7591