The easiest way to "disable" semihosting printf's is to reconfigure your project to link against a "nohost" variant of the C library. For SDK based projects, you can also reconfigure output in many cases so it is sent over a UART rather than the debug probe.
But alternatively, MCUXpresso IDE v10.1 allows projects which contain a hard fault handler that can trap and "recover" from a semihosted operation taking place when the debugger is not connected.
For more information please see chapter 13, "C/C++ Library Support" of the MCUXpresso IDE v10.1 User Guide.
Regards,
MCUXpresso IDE Support