Free watcher on socket read errors.

Fixes #5.
Add optimization to production build.