First-principles study of intrinsic defect properties in hexagonal BN bilayer and monolayer