Refine the mysqldump command

### Issue 1

The original mysql command was failing on a couple of server with the error:
`MySQL: Access denied when using LOCK TABLES`

Table locking can be avoided by forcing a single transaction for the dump, i.e. specifying the `--single-transaction` parameter to `mysqldump`.

### Issue 2

The password is passed directly in the command line, and can contain characters that interfere with bash, such as `$`. Pass it through the builtin PHP function `escapeshellcmd` to avoid these problems.