Have pick_avatar return json.

I'm working on writing a test in the discourse_api gem for uploading
avatars and the pick method needs to return a json response.

I also added a test to make sure json is returned.
Merge pull request #3024 from oblakeerickson/avatar_return_json

Have pick_avatar return json.