Add timeout option to plugin.

* Default behavior is the same as without this option.
* When timeout is provided, it will call failCallback() if there has been no response.