Change terminate/2 to terminate/3 for cowboy

For the changes in 
https://github.com/extend/cowboy/commit/647e95aed157edd58c86acdd774048593eb9d039