Fix replace_or_add() when regex chars used

replace_or_add(pattern, line) will currently break
if line incidentally contains special regular expression
characters. So $(line) should be escaped because it needs
to be matched literally.

For example, this fixes replace_or_add() when used in a crontab:

    replace_or_add(".*myscript.*", "* * * * * /usr/bin/myscript $(arg1)")