[core] fix write error when using non sector aligned DD images

* Closes #410