Handle float infinity and NAN s

Encoding them as null is better than 0: [roslibjs/issues/#68](https://github.com/RobotWebTools/roslibjs/issues/68#issuecomment-48515539)