optimize castToHTMLElement
fixes #383
https://github.com/silexlabs/Cocktail/issues/383#issuecomment-27710453