Fix a variety of bugs in vpi_handle_by_name.

This function was apparently not well tested, because any use of
acc_handle_object() triggered a use of vpi_handle_by_name that was
buggy.

The implementation was awkwardly written, to parts of it were redone.
Merge branch 'master' of github.com:steveicarus/iverilog