Properly escape special characters in MySQL credentials

Previously the code could handle almost all special characters by surrounding them with a single quotes.
Unfortunately that doesn't work if the credentials contain a single quote.
Ruby already includes the shellwords library which properly escape a string for use in a shell command.