Fixes bugs with attaching featured images to posts

This commit fixes two bugs in `WP_JSON_Media::attachThubmnail()`.

    - `attachThumbnail()` should dp nothing if `$update` is false since
    the post ID is needed.
    - The post ID must be fetched from the `$post` array.
Merge pull request #55 from Webbgaraget/master

Fixes bugs with attaching featured images to posts