Magistrates 'underfunded' says inspectorate report