Update Agent.scala

Removed the reference to close method since its removed from 2.2
Merge pull request #1594 from nraychaudhuri/patch-1

Update Agent.scala