fix($compile): work around issue in jQuery 1.10.2

jQuery 1.10.2 does not attach data to comment nodes, which previously broke `$compile`.
This changes how elements with "transclude element" and a controller are compiled to
avoid the issue.

Closes #3764