Magnetic properties and electronic structures of hcp Fe, Co and Ni nanowires encapsulated in a zigzag (12,0) BN nanotube