Fix iallocator crash when no solutions exist
Fix iallocator crash when no solutions exist

Commit 5436576 added an un-guarded `head' call, which crashes with
“Prelude.head: empty list” when no results exists for the per-instance
allocation/relocation calls.

This patch fixes this, and also adds another check for an unguarded
`head' call during parsing of input data.
(cherry picked from commit e41f4ba0ad09bcf3a696ab4eb7a1952e29f37d1f)

onponomarev/ganeti,ganeti/ganeti,bitemyapp/ganeti,mbakke/ganeti,ganeti-github-testing/ganeti-test-1,leshchevds/ganeti,apyrgio/ganeti,grnet/snf-ganeti,apyrgio/snf-ganeti,bitemyapp/ganeti,ganeti/ganeti,andir/ganeti,yiannist/ganeti,yiannist/ganeti,yiannist/ganeti,leshchevds/ganeti,apyrgio/snf-ganeti,grnet/snf-ganeti,ganeti-github-testing/ganeti-test-1,ganeti/ganeti,andir/ganeti,dimara/ganeti,onponomarev/ganeti,mbakke/ganeti,leshchevds/ganeti,apyrgio/ganeti,mbakke/ganeti,andir/ganeti,dimara/ganeti