Fixes bugs with attaching featured images to posts

This merge fixes two bugs in `WP_JSON_Media::attachThubmnail()`.

 - `attachThumbnail()` should do nothing if `$update` is false since
    the post ID is needed.
 - The post ID must be fetched from the `$post` array.


Edit: Spelling & syntax