Escape flash message

To get the flash message correctly displayed we need to escape the
message as it is part of an json object to prevent format errors.