Pass User ID while calling insert_activity function

For API development, user is not logged in, hence no user_id is inserted for activity. So need to pass it directly from $user variable.
Merge pull request #496 from UmeshSingla/patch-7

Pass User ID while calling insert_activity function for New  Media