Allow profiler max depth to be set in settings

Sometimes it's helpful to have a max depth of more than 10, which is currently hard-coded in the profiling panel.