[xbuild] Fix few crashes when task loading fails