Pātuhitia tēnei: CodeLutra: Boosting LLM Code Generation via Preference-Guided Refinement