Fixed safe resource close.
It must not de deleted (just closed), because it still may be referenced from zval(s).
This fixes few ext/ftp test memory failures detected with valgrind.