ir: Re-add edge_change_cnt() with improved interface.

This way there is one central place to check that the out_count is sane.
be: Remove the thin wrapper function arch_get_irn_reg_class().
be: Remove duplicate implementation of be_dump().
be: Give the enum of the dump flags a name and use it.
ir: Move be_get_Proj_for_pn() from the backend to the middleend as get_Proj_for_pn().
ir: Use get_Proj_for_pn().
ir: Move get_block() from the backend into the middleend.
ir: Use get_block().
amd64: Use sched_foreach_safe().