A former X-Factor contestant who had been accused of killing a baby girl has had a murder charge against him withdrawn.