Man accused of shooting a New Bedford detective arraigned in court