Merge branch 'bschubert/optimize-loader' into 'master'

Optimize loader

See merge request BuildStream/buildstream!1493