replace deprecated wpdb->escape() with esc_sql()
Merge pull request #521 from niallkennedy/esc_sql

replace deprecated wpdb->escape() with esc_sql()