bugfix: properly return end iterator during block write serialize.
additional test case for serialize unit test.