Japan PM agrees defence deal with Thailand