Poland averted 'direct threat' to border crossing, says premier