Set post ID when enqueueing media scripts.

Otherwise, the uploaded files will not be attached to the post.
Attach files to request and update list of attached files