HPCC-12341 Improve syntax checking for FORWARD modules (and fix core)

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>