Handle BEGIN{} around $VERSION in parse_version

Test added by @jhthorsen. Alternative solution, replacing get_version, by @shadowcat-mst.