Fix input validation logic on diag_testport.php, escape more shell arguments for good measure