lava-v2-jobs-from-api.py: split function to get builds
lava-v2-jobs-from-api.py: split function to get builds

Move the logic to get the list of builds outside of the main function
to make the code more readable.  Also get all the parameters from the
config object rather than mixing config and args.

Signed-off-by: Guillaume Tucker <e7e20b7c30f19d4ca6b81319ef81bf200369d137@collabora.com>

kernelci/lava-ci-staging,kernelci/lava-ci-staging,kernelci/lava-ci-staging