libblock: PR2040: Avoid NULL pointer access

This partly reverts commit 08b9d534604fbf437743a9925ef28eb1b848510d.

Avoid a NULL pointer access and perform the source segment erase if
necessary.