Better error message for semicolon on last line of function

closes #8005