fix tests on Node 0.8

it doesn’t have Buffer.toJSON