dialplan: fix shm leak when parsing invalid regex

Upon (re)load, if the subst or repl columns contain expressions which
fail to compile, OpenSIPS will leak shared memory.

Reported by miko95 on GitHub
Closes issue #307
(cherry picked from commit 72028d26bef361b6c99f6ad3653f0e1dbb07c767)