Decide whether the resource has to be closed in r_close().
Decide whether the resource has to be closed in r_close().

This avoids doing the test delayed during the r_free_cb() function, and
avoids the push to the thread pool entirely.

winlinvip/feng,winlinvip/feng,lscube/feng,lscube/feng,lscube/feng,winlinvip/feng