Added input validation for maxListeners

Added simple type validation for the for the input of the
setmaxListeners calls.