bug #1781: Replaces " by ' and escape ' using '\''. context.sh should be now sh-syntax secure

(cherry picked from commit 306aff89060a274ad402412639dda1302abd0055)