Merged ensureClosed methods to take a Closeable, this makes binding into a xamarin project cleaner.