Coherence as a resource for source-independent quantum random-number generation