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 #103 from arcusfelis/arc-muc-rsm

Fixed RSM in room discovery.
Merge pull request #98 from PaulSD/mod_bosh

mod_bosh inactivity timeout bugfix and new max_wait parameter
Add a message hook for MUC-rooms.
Add custom IQ handlers for room JID.
Add the hook forget_room.
Pass host as an argument of ejabberd_hooks:run_fold. Backported 3ed2a34d594.
Renamed the mod_muc_iq server (mod_muc_iq => ejabberd_mod_muc_iq). Fixed typo.
Inlined mod_muc_iq:srv_name/0.
Fixed errors in mod_muc_iq.

Conflicts:
	apps/ejabberd/src/mod_muc_iq.erl
Run the forget_room hook not globally, but locally for the passed host.
Merge branch 'arc-muc-hooks-picked' into arc-mod-mam-release

Conflicts:
	apps/ejabberd/src/ejabberd_sup.erl
	apps/ejabberd/src/mod_muc.erl
	apps/ejabberd/src/mod_muc_iq.erl