Some fixes using with callbacks

- Catched error if trying to open a non existent modem that causes exception trying to close a non opened port.
- calling callback(error) on errors.
- null pointer exception