Use JSON encoding rather than PHP serialization for storing group creation details in a browser cookie

PHP serialization and unserialization of user-provided input introduces
security vulnerabilities.

This is a port of r9017 to trunk.

Props DJPaul

git-svn-id: https://buddypress.svn.wordpress.org/trunk@9023 cdf35c40-ae34-48e0-9cc9-0c9da1808c22