Update BaseHtmlPurifier.php

Now checks for instance of closure