liblp: Move free-region calculation into a separate function.

In preparation for supporting multiple block devices, this factors out
the free-list calculation for resizing partitions.

Additionally, it fixes a bug where space in between the first usable
sector and the first extent wasn't added to the free list.

Bug: 116802789
Test: liblp_test gtest
Change-Id: I965760eef0176020e9a5691ce1be2c8b5e0c8bc8
3 files changed