Azerbaijan 'foils terrorist plot'