[YAML] fixed parsing inline serialized PHP objects

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6498
| License       | MIT
| Doc PR        | 

Closing braces might have been mistaken as string delimiters when a
serialized PHP object was embedded in an inline YAML string since
the method to parse scalars that are included in a map, uses the "}"
and "," characters as delimiters. Therefore, when the scalar to be
parsed is serialized PHP object, the parser now search for opening
braces in the serialized string and starts searching for the string
delimiters after all opening braces have been closed.