Escape injected end tags

This addresses the escaping issue reported in andreypopp/react-async#8 -- thanks for your help!

This solved my particular issue but I'd be happy to improve it if you have any suggestions.