Fix usage of onerror in the onclose section

Update the example to 
- use `onclose` and not `onerror`
- remove the `err` argument passed to the callback
Merge pull request #31 from jviereck/patch-1

Fix usage of onerror in the onclose section