properly handle null data when denormalizing

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10794
| License       | MIT
| Doc PR        | 
@fabpot I updated the pull request with what I had in mind. The ``denormalize()`` is now also capable to pass data to the constructor if the incoming ``$data`` is an object.