test-lib.sh: Add a test_set_editor function to safely set $VISUAL