A triangle singularity and the LHCb pentaquarks