Set separators for json.dump to avoid an extra space

By default json.dump puts an extra space at tail. The space should be removed.