Fix serializer.as_json(nil)

This is the form that ActiveSupport 3.1 Object#to_json invokes.
Merge pull request #477 from gtd/fix-as-json-with-nil

Allow serializer#as_json to be called with nil