XWIKI-9337: Memory leak in code macro
(cherry picked from commit ce8284fb3048d9801eb5d87c0a633382216457c0)