CDAP-537: close input streams

@gokulavasan please review