Bug 951142: check for a close method to be present on the binding before invoking it. r=gavin