Reference-frame-independent quantum key distribution with source flaws