local: Handle the case where less blocks than requested are allocated

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>