Fix erroneous inactivity timeouts in mod_bosh

If a client has a long-poll connection open to mod_bosh and needs to
send a message, it will open a new connection to mod_bosh to send the
message.  return_surplus_handlers() in mod_bosh_socket will then close
the old connection, and the new connection will become a long-poll.

When this happens, send_wrapped_to_handler() in the current code starts
the inactivity timer upon closing the old connection even though the
client has already established a new connection to replace it.  If the
inactivity timer is lower than the wait timer (as it is by default), and
the client does not receive any messages before the inactivity timer
fires, then the client will be disconnected.

This commit corrects the issue by only setting the inactivity timer if
there are no active handlers when send_wrapped_to_handler() is called.
Add a 'max_wait' option to mod_bosh

This allows the server administrator to limit the BOSH 'wait' parameter
to avoid issues caused by low network/firewall timeouts.
Merge pull request #98 from PaulSD/mod_bosh

mod_bosh inactivity timeout bugfix and new max_wait parameter