Currently I am using the below code to close all the browsers except the ALM browser from where I run the test suite from. However When I run the suite from ALM, the below code
Another option is to use ALM explorer.
Check this link for more information.
By using this you do not need to worry about closing any browser.
In Tools ⇒ Options ⇒ GUI Testing ⇒ Web
there is an Ignore ALM checkbox, this may be interfering with the Browser identification. Try setting/unsetting this checkbox and see if this solves your problem.