Clean up Document#save timestamp behavior.

Ensure that timestamps are reset when a save fails or throws an error. Also
ensure that timestamps for embedded documents are reset as well.

Temporarily increase the flake8 complexity threshold. Plan is to refactor
Document#save into insert and update sub-operations.  Increasing allowed
complexity until that is done.