A police officer has been arrested in connection with facilitating a suicide bomb attack at a mosque on the premises of a police compound in northwest Pakistan.