Fix the 'state' related issues in DOMSecureElement.js during closeXXX operations

Change-Id: I853cf3d27cab8af206b01b4494b0e609c08c5894