add a safe_mode check

Check if safe_mode is enabled. Safe_mode shoudn't be used nowadays. It created problems, is deprecated and  will be removed in 5.4 anyways.

@LukasReschke @schiesbn @DeepDiver1975