Tuning the electronic and magnetic properties in zigzag boron nitride nanoribbons with carbon dopants