[OLINGO-257] fix potential resource leaks