fix for #772 (bug when setting PIP_EXISTS_ACTION='s')

fixes #772 (bug when setting PIP_EXISTS_ACTION='s')

and prevents future bugs, if we ever had other choice options or non-'str' append options.

and adds some unit tests for our option parser.