When recording activity for doc creation, save the activity ID during
throttle lookup.

This is done so we don't create a new activity entry on doc edits.
Pass $query object to 'bp_docs_activity_args' filter for better
customization for plugin devs.
Fix activity action when posting a group doc.

The current codebase checks $query->item_type.  This variable is currently
empty as of v1.4.5.

This commit worksaround this by checking if the posted 'associated_group_id' field exists.  If it does, this is a good indicator
that a group is attached to this doc.

There is probably a better way to do this in the BP Doc query builder, but
I'm not too familiar with the BP Doc codebase yet.
Modify the activity arguments before saving a group doc.

This is so group docs are added into the appropriate group activity
stream.

This commit also tries to find the original 'bp_doc_created' activity
entry and if found, will update this activity entry instead of
creating a new one.