SafeCloseUtil: improve unit tests