Verify parens are balanced before executing gradient regex

Squashed version of https://github.com/adobe/brackets/pull/4885.

@JeffryBooher