Writing Memory Safe JIT Compilers