Don't unload blocks if save failed

Improve error handling in saveBlock()