Fix bugs when saving the document with no change in data.

Currently, ScriptableCollection.save method requests update of the document
even though there is no changed data. It causes no error on Linux, but causes
an error on Mac OS X.

This patch makes ScriptableCollection.save method requests update only when
there is a change in data.