Perl array fixes

A continuation of #720, because things are never perfect.

The first commit is a bit of a code cleanup of #720, I thought it was pretty ugly to have `fr_cursor_next_by_da(&cursor, vp->da, vp->tag)` twice in a single for-statement.

The second commit actually fixes a bug when copying multi-valued attributes to perl, it stopped where it should continue with the next attribute. The code isn't exactly the best I've ever written, but at least it works.