Protect shlex.split from crashing on malformed input; added test for that