Correctly trim notifications containing special characters.

JSON.stringify() escapes escaping characters. Notification.prototype.trim did not consider this anomaly so far. This commit precisely calculates the to be trimmed substring for notifications including special characters.