Allow serializer#as_json to be called with nil

This is the form that ActiveSupport 3.1 Object#to_json invokes as reported in #457.

Here's a greenfield 3.1.12 app with a minimal test demonstrating the problem: https://github.com/gtd/active_model_serializer_fail/commits/master

I don't think master supports Rails 3.1 anymore, but I'll have a look if there is still a failure path on the rewritten master.