Update print_gcode.py to handle changes in profile and buffer overflow exceptions

The profile is now an attribute on the factory object and no longer a method to be called.

When writing to the USB port the serial library will (likely) generate exceptions that are expected to be handled at higher levels by retrying the write (a form of poor mans polling for write buffer space).