Handle malformed PDUs

This change fixes a bug where malformed PDUs would throw an unexpected exception (which could cause the application to crash). This change catches malformed PDUs, emits an error event, and closes the SMPP session.