XD-990 Better exception handling for close of streams

Adding stream closing code in StreamsHolder which removes
boilerplate code from its user. Catch and throw error
if multiple holders are closed within a same call so
that all streams are tried to get closed.